From e2c24cf8c5ef0d752bca962b5859810b02a4568b Mon Sep 17 00:00:00 2001 From: Nivedita Chopra Date: Tue, 4 Sep 2018 10:21:58 -0700 Subject: [PATCH] Update prettier version to 1.13.6 (#1854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: **Summary** Updating to 1.13.6 which is the version used internally in Facebook's codebase, so that there are no conflicts in how prettier dictates formatting. Right now, we're seeing an issue where 1.13.6 dictates different formatting for nested ternary operators & this broke the Travis CI in https://github.com/facebook/draft-js/compare/0cb80b775ecd...fbc8a0cbfce6#diff-4e6b8232e09a07f699eebad1949b3ba3L118 Looks like the earlier breakage due to prettier version upgrade reported in https://github.com/facebook/draft-js/issues/1562 is now not an issue with a much higher version :) **Test Plan** Before fix (breakage in Travis at https://travis-ci.org/facebook/draft-js/jobs/424170309): ``` $ eslint . /home/travis/build/facebook/draft-js/src/model/immutable/BlockTree.js 30:7 warning 'FINGERPRINT_DELIMITER' is assigned a value but never used. Allowed unused vars must match /^_/ no-unused-vars /home/travis/build/facebook/draft-js/src/model/transaction/moveBlockInContentState.js 119:33 error Replace `⏎··········?·targetBlockIndex·-·1⏎·········` with `·?·targetBlockIndex·-·1` prettier/prettier ✖ 2 problems (1 error, 1 warning) 1 error, 0 warnings potentially fixable with the `--fix` option. ``` After fix: ``` > yarn run lint Using globally installed version of Yarn yarn run v1.5.1 $ eslint . /Users/niveditc/draft-js/src/model/immutable/BlockTree.js 30:7 warning 'FINGERPRINT_DELIMITER' is assigned a value but never used. Allowed unused vars must match /^_/ no-unused-vars ✖ 1 problem (0 errors, 1 warning) ✨ Done in 8.50s. ``` (will be fixing the warning separately, that's been ongoing for a while). Pull Request resolved: https://github.com/facebook/draft-js/pull/1854 Reviewed By: elboman Differential Revision: D9636114 Pulled By: elboman fbshipit-source-id: 037c692554976b4626e27d3ebc0ccf95922bfb38 --- meta/bundle-size-stats/Draft.js.json | 2 +- meta/bundle-size-stats/Draft.min.js.json | 2 +- package.json | 2 +- yarn.lock | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meta/bundle-size-stats/Draft.js.json b/meta/bundle-size-stats/Draft.js.json index f05fc8e02d..1668e75e55 100644 --- a/meta/bundle-size-stats/Draft.js.json +++ b/meta/bundle-size-stats/Draft.js.json @@ -1 +1 @@ -{"errors":[],"warnings":[],"version":"3.10.0","hash":"ae9cd7593d3adce6dc12","publicPath":"","assetsByChunkName":{"main":"Draft.js"},"assets":[{"name":"Draft.js","size":580360,"chunks":[0],"chunkNames":["main"],"emitted":true},{"name":"../meta/bundle-size-stats/Draft.js.json","size":0,"chunks":[],"chunkNames":[]}],"filteredAssets":0,"entrypoints":{"main":{"chunks":[0],"assets":["Draft.js"]}},"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"extraAsync":false,"size":567977,"names":["main"],"files":["Draft.js"],"hash":"e897b5d558fdd5a32a79","parents":[],"modules":[{"id":0,"identifier":"external {\"root\":\"Immutable\",\"commonjs2\":\"immutable\",\"commonjs\":\"immutable\",\"amd\":\"immutable\"}","name":"external {\"root\":\"Immutable\",\"commonjs2\":\"immutable\",\"commonjs\":\"immutable\",\"amd\":\"immutable\"}","index":4,"index2":1,"size":42,"cacheable":false,"built":false,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","issuerId":70,"issuerName":"./lib/AtomicBlockUtils.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"immutable","loc":"24:16-36"},{"moduleId":4,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/CharacterMetadata.js","module":"./lib/CharacterMetadata.js","moduleName":"./lib/CharacterMetadata.js","type":"cjs require","userRequest":"immutable","loc":"21:15-35"},{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"immutable","loc":"17:16-36"},{"moduleId":6,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlockNode.js","module":"./lib/ContentBlockNode.js","moduleName":"./lib/ContentBlockNode.js","type":"cjs require","userRequest":"immutable","loc":"28:16-36"},{"moduleId":13,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlock.js","module":"./lib/ContentBlock.js","moduleName":"./lib/ContentBlock.js","type":"cjs require","userRequest":"immutable","loc":"22:16-36"},{"moduleId":17,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SelectionState.js","module":"./lib/SelectionState.js","moduleName":"./lib/SelectionState.js","type":"cjs require","userRequest":"immutable","loc":"21:16-36"},{"moduleId":19,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockMapBuilder.js","module":"./lib/BlockMapBuilder.js","moduleName":"./lib/BlockMapBuilder.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":21,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntity.js","module":"./lib/DraftEntity.js","moduleName":"./lib/DraftEntity.js","type":"cjs require","userRequest":"immutable","loc":"20:16-36"},{"moduleId":26,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","module":"./lib/DefaultDraftBlockRenderMap.js","moduleName":"./lib/DefaultDraftBlockRenderMap.js","type":"cjs require","userRequest":"immutable","loc":"15:15-35"},{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"immutable","loc":"26:16-36"},{"moduleId":41,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/randomizeBlockMapKeys.js","module":"./lib/randomizeBlockMapKeys.js","moduleName":"./lib/randomizeBlockMapKeys.js","type":"cjs require","userRequest":"immutable","loc":"16:16-36"},{"moduleId":45,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntityInstance.js","module":"./lib/DraftEntityInstance.js","moduleName":"./lib/DraftEntityInstance.js","type":"cjs require","userRequest":"immutable","loc":"22:16-36"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"immutable","loc":"27:16-36"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"immutable","loc":"29:15-35"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"immutable","loc":"30:15-35"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"immutable","loc":"25:16-36"},{"moduleId":71,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentStateInlineStyle.js","module":"./lib/ContentStateInlineStyle.js","moduleName":"./lib/ContentStateInlineStyle.js","type":"cjs require","userRequest":"immutable","loc":"17:15-35"},{"moduleId":72,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentState.js","module":"./lib/applyEntityToContentState.js","moduleName":"./lib/applyEntityToContentState.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"immutable","loc":"17:16-36"},{"moduleId":78,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertTextIntoContentState.js","module":"./lib/insertTextIntoContentState.js","moduleName":"./lib/insertTextIntoContentState.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":79,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/modifyBlockForContentState.js","module":"./lib/modifyBlockForContentState.js","moduleName":"./lib/modifyBlockForContentState.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":80,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeRangeFromContentState.js","module":"./lib/removeRangeFromContentState.js","moduleName":"./lib/removeRangeFromContentState.js","type":"cjs require","userRequest":"immutable","loc":"16:16-36"},{"moduleId":81,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/splitBlockInContentState.js","module":"./lib/splitBlockInContentState.js","moduleName":"./lib/splitBlockInContentState.js","type":"cjs require","userRequest":"immutable","loc":"16:16-36"},{"moduleId":82,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockTree.js","module":"./lib/BlockTree.js","moduleName":"./lib/BlockTree.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":83,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorBidiService.js","module":"./lib/EditorBidiService.js","moduleName":"./lib/EditorBidiService.js","type":"cjs require","userRequest":"immutable","loc":"15:16-36"},{"moduleId":85,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","module":"./lib/moveBlockInContentState.js","moduleName":"./lib/moveBlockInContentState.js","type":"cjs require","userRequest":"immutable","loc":"16:16-36"},{"moduleId":86,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/CompositeDraftDecorator.js","module":"./lib/CompositeDraftDecorator.js","moduleName":"./lib/CompositeDraftDecorator.js","type":"cjs require","userRequest":"immutable","loc":"17:16-36"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"immutable","loc":"33:16-36"},{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"immutable","loc":"27:16-36"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"immutable","loc":"22:16-36"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"immutable","loc":"24:16-36"},{"moduleId":155,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/createCharacterList.js","module":"./lib/createCharacterList.js","moduleName":"./lib/createCharacterList.js","type":"cjs require","userRequest":"immutable","loc":"16:16-36"},{"moduleId":157,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/decodeInlineStyleRanges.js","module":"./lib/decodeInlineStyleRanges.js","moduleName":"./lib/decodeInlineStyleRanges.js","type":"cjs require","userRequest":"immutable","loc":"15:15-35"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2},{"id":1,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/invariant.js","name":"./node_modules/fbjs/lib/invariant.js","index":16,"index2":11,"size":1506,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"25:16-45"},{"moduleId":16,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeUtils.js","module":"./node_modules/fbjs/lib/UnicodeUtils.js","moduleName":"./node_modules/fbjs/lib/UnicodeUtils.js","type":"cjs require","userRequest":"./invariant","loc":"23:16-38"},{"moduleId":21,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntity.js","module":"./lib/DraftEntity.js","moduleName":"./lib/DraftEntity.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"22:16-45"},{"moduleId":25,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiDirection.js","module":"./node_modules/fbjs/lib/UnicodeBidiDirection.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidiDirection.js","type":"cjs require","userRequest":"./invariant","loc":"27:16-38"},{"moduleId":32,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidi.js","module":"./node_modules/fbjs/lib/UnicodeBidi.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidi.js","type":"cjs require","userRequest":"./invariant","loc":"23:16-38"},{"moduleId":40,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getSafeBodyFromHTML.js","module":"./lib/getSafeBodyFromHTML.js","moduleName":"./lib/getSafeBodyFromHTML.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"17:16-45"},{"moduleId":42,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeEntitiesAtEdges.js","module":"./lib/removeEntitiesAtEdges.js","moduleName":"./lib/removeEntitiesAtEdges.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"18:16-45"},{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"27:16-45"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"38:16-45"},{"moduleId":56,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getTextContentFromFiles.js","module":"./lib/getTextContentFromFiles.js","moduleName":"./lib/getTextContentFromFiles.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"15:16-45"},{"moduleId":59,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangeClientRects.js","module":"./lib/getRangeClientRects.js","moduleName":"./lib/getRangeClientRects.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"17:16-45"},{"moduleId":60,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","module":"./lib/getDraftEditorSelectionWithNodes.js","moduleName":"./lib/getDraftEditorSelectionWithNodes.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"18:16-45"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"38:16-45"},{"moduleId":74,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","module":"./lib/getCharacterRemovalRange.js","moduleName":"./lib/getCharacterRemovalRange.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"18:16-45"},{"moduleId":76,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangesForDraftEntity.js","module":"./lib/getRangesForDraftEntity.js","moduleName":"./lib/getRangesForDraftEntity.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"15:16-45"},{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"20:16-45"},{"moduleId":78,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertTextIntoContentState.js","module":"./lib/insertTextIntoContentState.js","moduleName":"./lib/insertTextIntoContentState.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"18:16-45"},{"moduleId":81,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/splitBlockInContentState.js","module":"./lib/splitBlockInContentState.js","moduleName":"./lib/splitBlockInContentState.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"19:16-45"},{"moduleId":84,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiService.js","module":"./node_modules/fbjs/lib/UnicodeBidiService.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidiService.js","type":"cjs require","userRequest":"./invariant","loc":"48:16-38"},{"moduleId":85,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","module":"./lib/moveBlockInContentState.js","moduleName":"./lib/moveBlockInContentState.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"19:16-45"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"47:16-45"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"42:16-45"},{"moduleId":94,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorTextNode.react.js","module":"./lib/DraftEditorTextNode.react.js","moduleName":"./lib/DraftEditorTextNode.react.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"25:16-45"},{"moduleId":98,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/VersionRange.js","module":"./node_modules/fbjs/lib/VersionRange.js","moduleName":"./node_modules/fbjs/lib/VersionRange.js","type":"cjs require","userRequest":"./invariant","loc":"11:16-38"},{"moduleId":101,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","module":"./lib/setDraftEditorSelection.js","moduleName":"./lib/setDraftEditorSelection.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"19:16-45"},{"moduleId":114,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/createArrayFromMixed.js","module":"./node_modules/fbjs/lib/createArrayFromMixed.js","moduleName":"./node_modules/fbjs/lib/createArrayFromMixed.js","type":"cjs require","userRequest":"./invariant","loc":"12:16-38"},{"moduleId":131,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/expandRangeToStartOfLine.js","module":"./lib/expandRangeToStartOfLine.js","moduleName":"./lib/expandRangeToStartOfLine.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"18:16-45"},{"moduleId":146,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnSelect.js","module":"./lib/editOnSelect.js","moduleName":"./lib/editOnSelect.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"20:16-45"},{"moduleId":150,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","module":"./lib/convertFromDraftStateToRaw.js","moduleName":"./lib/convertFromDraftStateToRaw.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"25:16-45"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"32:16-45"},{"moduleId":154,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftTreeAdapter.js","module":"./lib/DraftTreeAdapter.js","moduleName":"./lib/DraftTreeAdapter.js","type":"cjs require","userRequest":"fbjs/lib/invariant","loc":"22:16-45"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;"},{"id":2,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","name":"./lib/EditorState.js","index":29,"index2":39,"size":18750,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":66,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/RichTextEditorUtil.js","module":"./lib/RichTextEditorUtil.js","moduleName":"./lib/RichTextEditorUtil.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./EditorState","loc":"28:18-42"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./EditorState","loc":"24:18-42"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./EditorState","loc":"34:18-42"},{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"./EditorState","loc":"32:18-42"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"./EditorState","loc":"32:18-42"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"./EditorState","loc":"27:18-42"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./EditorState","loc":"17:18-42"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":120,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","module":"./lib/editOnBlur.js","moduleName":"./lib/editOnBlur.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":121,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCompositionStart.js","module":"./lib/editOnCompositionStart.js","moduleName":"./lib/editOnCompositionStart.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":123,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCut.js","module":"./lib/editOnCut.js","moduleName":"./lib/editOnCut.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":126,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnFocus.js","module":"./lib/editOnFocus.js","moduleName":"./lib/editOnFocus.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"./EditorState","loc":"17:18-42"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":129,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SecondaryClipboard.js","module":"./lib/SecondaryClipboard.js","moduleName":"./lib/SecondaryClipboard.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":130,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","module":"./lib/keyCommandBackspaceToStartOfLine.js","moduleName":"./lib/keyCommandBackspaceToStartOfLine.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":132,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceWord.js","module":"./lib/keyCommandBackspaceWord.js","moduleName":"./lib/keyCommandBackspaceWord.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":134,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandDeleteWord.js","module":"./lib/keyCommandDeleteWord.js","moduleName":"./lib/keyCommandDeleteWord.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":135,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandInsertNewline.js","module":"./lib/keyCommandInsertNewline.js","moduleName":"./lib/keyCommandInsertNewline.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":136,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandMoveSelectionToEndOfBlock.js","module":"./lib/keyCommandMoveSelectionToEndOfBlock.js","moduleName":"./lib/keyCommandMoveSelectionToEndOfBlock.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":137,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandMoveSelectionToStartOfBlock.js","module":"./lib/keyCommandMoveSelectionToStartOfBlock.js","moduleName":"./lib/keyCommandMoveSelectionToStartOfBlock.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":138,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainBackspace.js","module":"./lib/keyCommandPlainBackspace.js","moduleName":"./lib/keyCommandPlainBackspace.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":139,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainDelete.js","module":"./lib/keyCommandPlainDelete.js","moduleName":"./lib/keyCommandPlainDelete.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":140,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandTransposeCharacters.js","module":"./lib/keyCommandTransposeCharacters.js","moduleName":"./lib/keyCommandTransposeCharacters.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"},{"moduleId":141,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandUndo.js","module":"./lib/keyCommandUndo.js","moduleName":"./lib/keyCommandUndo.js","type":"cjs require","userRequest":"./EditorState","loc":"15:18-42"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./EditorState","loc":"20:18-42"},{"moduleId":146,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnSelect.js","module":"./lib/editOnSelect.js","moduleName":"./lib/editOnSelect.js","type":"cjs require","userRequest":"./EditorState","loc":"16:18-42"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BlockTree = require('./BlockTree');\nvar ContentState = require('./ContentState');\nvar EditorBidiService = require('./EditorBidiService');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar OrderedSet = Immutable.OrderedSet,\n Record = Immutable.Record,\n Stack = Immutable.Stack;\n\n\nvar defaultRecord = {\n allowUndo: true,\n currentContent: null,\n decorator: null,\n directionMap: null,\n forceSelection: false,\n inCompositionMode: false,\n inlineStyleOverride: null,\n lastChangeType: null,\n nativelyRenderedContent: null,\n redoStack: Stack(),\n selection: null,\n treeMap: null,\n undoStack: Stack()\n};\n\nvar EditorStateRecord = Record(defaultRecord);\n\nvar EditorState = function () {\n EditorState.createEmpty = function createEmpty(decorator) {\n return EditorState.createWithContent(ContentState.createFromText(''), decorator);\n };\n\n EditorState.createWithContent = function createWithContent(contentState, decorator) {\n var firstKey = contentState.getBlockMap().first().getKey();\n return EditorState.create({\n currentContent: contentState,\n undoStack: Stack(),\n redoStack: Stack(),\n decorator: decorator || null,\n selection: SelectionState.createEmpty(firstKey)\n });\n };\n\n EditorState.create = function create(config) {\n var currentContent = config.currentContent,\n decorator = config.decorator;\n\n var recordConfig = _extends({}, config, {\n treeMap: generateNewTreeMap(currentContent, decorator),\n directionMap: EditorBidiService.getDirectionMap(currentContent)\n });\n return new EditorState(new EditorStateRecord(recordConfig));\n };\n\n EditorState.set = function set(editorState, put) {\n var map = editorState.getImmutable().withMutations(function (state) {\n var existingDecorator = state.get('decorator');\n var decorator = existingDecorator;\n if (put.decorator === null) {\n decorator = null;\n } else if (put.decorator) {\n decorator = put.decorator;\n }\n\n var newContent = put.currentContent || editorState.getCurrentContent();\n\n if (decorator !== existingDecorator) {\n var _treeMap = state.get('treeMap');\n var newTreeMap = void 0;\n if (decorator && existingDecorator) {\n newTreeMap = regenerateTreeForNewDecorator(newContent, newContent.getBlockMap(), _treeMap, decorator, existingDecorator);\n } else {\n newTreeMap = generateNewTreeMap(newContent, decorator);\n }\n\n state.merge({\n decorator: decorator,\n treeMap: newTreeMap,\n nativelyRenderedContent: null\n });\n return;\n }\n\n var existingContent = editorState.getCurrentContent();\n if (newContent !== existingContent) {\n state.set('treeMap', regenerateTreeForNewBlocks(editorState, newContent.getBlockMap(), newContent.getEntityMap(), decorator));\n }\n\n state.merge(put);\n });\n\n return new EditorState(map);\n };\n\n EditorState.prototype.toJS = function toJS() {\n return this.getImmutable().toJS();\n };\n\n EditorState.prototype.getAllowUndo = function getAllowUndo() {\n return this.getImmutable().get('allowUndo');\n };\n\n EditorState.prototype.getCurrentContent = function getCurrentContent() {\n return this.getImmutable().get('currentContent');\n };\n\n EditorState.prototype.getUndoStack = function getUndoStack() {\n return this.getImmutable().get('undoStack');\n };\n\n EditorState.prototype.getRedoStack = function getRedoStack() {\n return this.getImmutable().get('redoStack');\n };\n\n EditorState.prototype.getSelection = function getSelection() {\n return this.getImmutable().get('selection');\n };\n\n EditorState.prototype.getDecorator = function getDecorator() {\n return this.getImmutable().get('decorator');\n };\n\n EditorState.prototype.isInCompositionMode = function isInCompositionMode() {\n return this.getImmutable().get('inCompositionMode');\n };\n\n EditorState.prototype.mustForceSelection = function mustForceSelection() {\n return this.getImmutable().get('forceSelection');\n };\n\n EditorState.prototype.getNativelyRenderedContent = function getNativelyRenderedContent() {\n return this.getImmutable().get('nativelyRenderedContent');\n };\n\n EditorState.prototype.getLastChangeType = function getLastChangeType() {\n return this.getImmutable().get('lastChangeType');\n };\n\n /**\n * While editing, the user may apply inline style commands with a collapsed\n * cursor, intending to type text that adopts the specified style. In this\n * case, we track the specified style as an \"override\" that takes precedence\n * over the inline style of the text adjacent to the cursor.\n *\n * If null, there is no override in place.\n */\n\n\n EditorState.prototype.getInlineStyleOverride = function getInlineStyleOverride() {\n return this.getImmutable().get('inlineStyleOverride');\n };\n\n EditorState.setInlineStyleOverride = function setInlineStyleOverride(editorState, inlineStyleOverride) {\n return EditorState.set(editorState, { inlineStyleOverride: inlineStyleOverride });\n };\n\n /**\n * Get the appropriate inline style for the editor state. If an\n * override is in place, use it. Otherwise, the current style is\n * based on the location of the selection state.\n */\n\n\n EditorState.prototype.getCurrentInlineStyle = function getCurrentInlineStyle() {\n var override = this.getInlineStyleOverride();\n if (override != null) {\n return override;\n }\n\n var content = this.getCurrentContent();\n var selection = this.getSelection();\n\n if (selection.isCollapsed()) {\n return getInlineStyleForCollapsedSelection(content, selection);\n }\n\n return getInlineStyleForNonCollapsedSelection(content, selection);\n };\n\n EditorState.prototype.getBlockTree = function getBlockTree(blockKey) {\n return this.getImmutable().getIn(['treeMap', blockKey]);\n };\n\n EditorState.prototype.isSelectionAtStartOfContent = function isSelectionAtStartOfContent() {\n var firstKey = this.getCurrentContent().getBlockMap().first().getKey();\n return this.getSelection().hasEdgeWithin(firstKey, 0, 0);\n };\n\n EditorState.prototype.isSelectionAtEndOfContent = function isSelectionAtEndOfContent() {\n var content = this.getCurrentContent();\n var blockMap = content.getBlockMap();\n var last = blockMap.last();\n var end = last.getLength();\n return this.getSelection().hasEdgeWithin(last.getKey(), end, end);\n };\n\n EditorState.prototype.getDirectionMap = function getDirectionMap() {\n return this.getImmutable().get('directionMap');\n };\n\n /**\n * Incorporate native DOM selection changes into the EditorState. This\n * method can be used when we simply want to accept whatever the DOM\n * has given us to represent selection, and we do not need to re-render\n * the editor.\n *\n * To forcibly move the DOM selection, see `EditorState.forceSelection`.\n */\n\n\n EditorState.acceptSelection = function acceptSelection(editorState, selection) {\n return updateSelection(editorState, selection, false);\n };\n\n /**\n * At times, we need to force the DOM selection to be where we\n * need it to be. This can occur when the anchor or focus nodes\n * are non-text nodes, for instance. In this case, we want to trigger\n * a re-render of the editor, which in turn forces selection into\n * the correct place in the DOM. The `forceSelection` method\n * accomplishes this.\n *\n * This method should be used in cases where you need to explicitly\n * move the DOM selection from one place to another without a change\n * in ContentState.\n */\n\n\n EditorState.forceSelection = function forceSelection(editorState, selection) {\n if (!selection.getHasFocus()) {\n selection = selection.set('hasFocus', true);\n }\n return updateSelection(editorState, selection, true);\n };\n\n /**\n * Move selection to the end of the editor without forcing focus.\n */\n\n\n EditorState.moveSelectionToEnd = function moveSelectionToEnd(editorState) {\n var content = editorState.getCurrentContent();\n var lastBlock = content.getLastBlock();\n var lastKey = lastBlock.getKey();\n var length = lastBlock.getLength();\n\n return EditorState.acceptSelection(editorState, new SelectionState({\n anchorKey: lastKey,\n anchorOffset: length,\n focusKey: lastKey,\n focusOffset: length,\n isBackward: false\n }));\n };\n\n /**\n * Force focus to the end of the editor. This is useful in scenarios\n * where we want to programmatically focus the input and it makes sense\n * to allow the user to continue working seamlessly.\n */\n\n\n EditorState.moveFocusToEnd = function moveFocusToEnd(editorState) {\n var afterSelectionMove = EditorState.moveSelectionToEnd(editorState);\n return EditorState.forceSelection(afterSelectionMove, afterSelectionMove.getSelection());\n };\n\n /**\n * Push the current ContentState onto the undo stack if it should be\n * considered a boundary state, and set the provided ContentState as the\n * new current content.\n */\n\n\n EditorState.push = function push(editorState, contentState, changeType) {\n if (editorState.getCurrentContent() === contentState) {\n return editorState;\n }\n\n var forceSelection = changeType !== 'insert-characters';\n var directionMap = EditorBidiService.getDirectionMap(contentState, editorState.getDirectionMap());\n\n if (!editorState.getAllowUndo()) {\n return EditorState.set(editorState, {\n currentContent: contentState,\n directionMap: directionMap,\n lastChangeType: changeType,\n selection: contentState.getSelectionAfter(),\n forceSelection: forceSelection,\n inlineStyleOverride: null\n });\n }\n\n var selection = editorState.getSelection();\n var currentContent = editorState.getCurrentContent();\n var undoStack = editorState.getUndoStack();\n var newContent = contentState;\n\n if (selection !== currentContent.getSelectionAfter() || mustBecomeBoundary(editorState, changeType)) {\n undoStack = undoStack.push(currentContent);\n newContent = newContent.set('selectionBefore', selection);\n } else if (changeType === 'insert-characters' || changeType === 'backspace-character' || changeType === 'delete-character') {\n // Preserve the previous selection.\n newContent = newContent.set('selectionBefore', currentContent.getSelectionBefore());\n }\n\n var inlineStyleOverride = editorState.getInlineStyleOverride();\n\n // Don't discard inline style overrides for the following change types:\n var overrideChangeTypes = ['adjust-depth', 'change-block-type', 'split-block'];\n\n if (overrideChangeTypes.indexOf(changeType) === -1) {\n inlineStyleOverride = null;\n }\n\n var editorStateChanges = {\n currentContent: newContent,\n directionMap: directionMap,\n undoStack: undoStack,\n redoStack: Stack(),\n lastChangeType: changeType,\n selection: contentState.getSelectionAfter(),\n forceSelection: forceSelection,\n inlineStyleOverride: inlineStyleOverride\n };\n\n return EditorState.set(editorState, editorStateChanges);\n };\n\n /**\n * Make the top ContentState in the undo stack the new current content and\n * push the current content onto the redo stack.\n */\n\n\n EditorState.undo = function undo(editorState) {\n if (!editorState.getAllowUndo()) {\n return editorState;\n }\n\n var undoStack = editorState.getUndoStack();\n var newCurrentContent = undoStack.peek();\n if (!newCurrentContent) {\n return editorState;\n }\n\n var currentContent = editorState.getCurrentContent();\n var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());\n\n return EditorState.set(editorState, {\n currentContent: newCurrentContent,\n directionMap: directionMap,\n undoStack: undoStack.shift(),\n redoStack: editorState.getRedoStack().push(currentContent),\n forceSelection: true,\n inlineStyleOverride: null,\n lastChangeType: 'undo',\n nativelyRenderedContent: null,\n selection: currentContent.getSelectionBefore()\n });\n };\n\n /**\n * Make the top ContentState in the redo stack the new current content and\n * push the current content onto the undo stack.\n */\n\n\n EditorState.redo = function redo(editorState) {\n if (!editorState.getAllowUndo()) {\n return editorState;\n }\n\n var redoStack = editorState.getRedoStack();\n var newCurrentContent = redoStack.peek();\n if (!newCurrentContent) {\n return editorState;\n }\n\n var currentContent = editorState.getCurrentContent();\n var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());\n\n return EditorState.set(editorState, {\n currentContent: newCurrentContent,\n directionMap: directionMap,\n undoStack: editorState.getUndoStack().push(currentContent),\n redoStack: redoStack.shift(),\n forceSelection: true,\n inlineStyleOverride: null,\n lastChangeType: 'redo',\n nativelyRenderedContent: null,\n selection: newCurrentContent.getSelectionAfter()\n });\n };\n\n /**\n * Not for public consumption.\n */\n\n\n function EditorState(immutable) {\n _classCallCheck(this, EditorState);\n\n this._immutable = immutable;\n }\n\n /**\n * Not for public consumption.\n */\n\n\n EditorState.prototype.getImmutable = function getImmutable() {\n return this._immutable;\n };\n\n return EditorState;\n}();\n\n/**\n * Set the supplied SelectionState as the new current selection, and set\n * the `force` flag to trigger manual selection placement by the view.\n */\n\n\nfunction updateSelection(editorState, selection, forceSelection) {\n return EditorState.set(editorState, {\n selection: selection,\n forceSelection: forceSelection,\n nativelyRenderedContent: null,\n inlineStyleOverride: null\n });\n}\n\n/**\n * Regenerate the entire tree map for a given ContentState and decorator.\n * Returns an OrderedMap that maps all available ContentBlock objects.\n */\nfunction generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}\n\n/**\n * Regenerate tree map objects for all ContentBlocks that have changed\n * between the current editorState and newContent. Returns an OrderedMap\n * with only changed regenerated tree map objects.\n */\nfunction regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}\n\n/**\n * Generate tree map objects for a new decorator object, preserving any\n * decorations that are unchanged from the previous decorator.\n *\n * Note that in order for this to perform optimally, decoration Lists for\n * decorators should be preserved when possible to allow for direct immutable\n * List comparison.\n */\nfunction regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}\n\n/**\n * Return whether a change should be considered a boundary state, given\n * the previous change type. Allows us to discard potential boundary states\n * during standard typing or deletion behavior.\n */\nfunction mustBecomeBoundary(editorState, changeType) {\n var lastChangeType = editorState.getLastChangeType();\n return changeType !== lastChangeType || changeType !== 'insert-characters' && changeType !== 'backspace-character' && changeType !== 'delete-character';\n}\n\nfunction getInlineStyleForCollapsedSelection(content, selection) {\n var startKey = selection.getStartKey();\n var startOffset = selection.getStartOffset();\n var startBlock = content.getBlockForKey(startKey);\n\n // If the cursor is not at the start of the block, look backward to\n // preserve the style of the preceding character.\n if (startOffset > 0) {\n return startBlock.getInlineStyleAt(startOffset - 1);\n }\n\n // The caret is at position zero in this block. If the block has any\n // text at all, use the style of the first character.\n if (startBlock.getLength()) {\n return startBlock.getInlineStyleAt(0);\n }\n\n // Otherwise, look upward in the document to find the closest character.\n return lookUpwardForInlineStyle(content, startKey);\n}\n\nfunction getInlineStyleForNonCollapsedSelection(content, selection) {\n var startKey = selection.getStartKey();\n var startOffset = selection.getStartOffset();\n var startBlock = content.getBlockForKey(startKey);\n\n // If there is a character just inside the selection, use its style.\n if (startOffset < startBlock.getLength()) {\n return startBlock.getInlineStyleAt(startOffset);\n }\n\n // Check if the selection at the end of a non-empty block. Use the last\n // style in the block.\n if (startOffset > 0) {\n return startBlock.getInlineStyleAt(startOffset - 1);\n }\n\n // Otherwise, look upward in the document to find the closest character.\n return lookUpwardForInlineStyle(content, startKey);\n}\n\nfunction lookUpwardForInlineStyle(content, fromKey) {\n var lastNonEmpty = content.getBlockMap().reverse().skipUntil(function (_, k) {\n return k === fromKey;\n }).skip(1).skipUntil(function (block, _) {\n return block.getLength();\n }).first();\n\n if (lastNonEmpty) return lastNonEmpty.getInlineStyleAt(lastNonEmpty.getLength() - 1);\n return OrderedSet();\n}\n\nmodule.exports = EditorState;"},{"id":3,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/object-assign/index.js","name":"./node_modules/object-assign/index.js","index":2,"index2":0,"size":2108,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","issuerId":70,"issuerName":"./lib/AtomicBlockUtils.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":21,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntity.js","module":"./lib/DraftEntity.js","moduleName":"./lib/DraftEntity.js","type":"cjs require","userRequest":"object-assign","loc":"3:14-38"},{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"object-assign","loc":"18:14-38"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"object-assign","loc":"18:14-38"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"object-assign","loc":"16:14-38"},{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"object-assign","loc":"20:14-38"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"object-assign","loc":"20:14-38"},{"moduleId":93,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","module":"./lib/DraftEditorDecoratedLeaves.react.js","moduleName":"./lib/DraftEditorDecoratedLeaves.react.js","type":"cjs require","userRequest":"object-assign","loc":"18:14-38"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":150,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","module":"./lib/convertFromDraftStateToRaw.js","moduleName":"./lib/convertFromDraftStateToRaw.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"object-assign","loc":"15:14-38"},{"moduleId":154,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftTreeAdapter.js","module":"./lib/DraftTreeAdapter.js","moduleName":"./lib/DraftTreeAdapter.js","type":"cjs require","userRequest":"object-assign","loc":"3:14-38"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n"},{"id":4,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/CharacterMetadata.js","name":"./lib/CharacterMetadata.js","index":5,"index2":3,"size":3809,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"15:24-54"},{"moduleId":6,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlockNode.js","module":"./lib/ContentBlockNode.js","moduleName":"./lib/ContentBlockNode.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"27:24-54"},{"moduleId":13,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlock.js","module":"./lib/ContentBlock.js","moduleName":"./lib/ContentBlock.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"21:24-54"},{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"22:24-54"},{"moduleId":42,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeEntitiesAtEdges.js","module":"./lib/removeEntitiesAtEdges.js","moduleName":"./lib/removeEntitiesAtEdges.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"15:24-54"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"22:24-54"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"24:24-54"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"17:24-54"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"20:24-54"},{"moduleId":71,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentStateInlineStyle.js","module":"./lib/ContentStateInlineStyle.js","moduleName":"./lib/ContentStateInlineStyle.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"15:24-54"},{"moduleId":73,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentBlock.js","module":"./lib/applyEntityToContentBlock.js","moduleName":"./lib/applyEntityToContentBlock.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"15:24-54"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"16:24-54"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"19:24-54"},{"moduleId":155,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/createCharacterList.js","module":"./lib/createCharacterList.js","moduleName":"./lib/createCharacterList.js","type":"cjs require","userRequest":"./CharacterMetadata","loc":"15:24-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar _require = require('immutable'),\n Map = _require.Map,\n OrderedSet = _require.OrderedSet,\n Record = _require.Record;\n\n// Immutable.map is typed such that the value for every key in the map\n// must be the same type\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n style: EMPTY_SET,\n entity: null\n};\n\nvar CharacterMetadataRecord = Record(defaultRecord);\n\nvar CharacterMetadata = function (_CharacterMetadataRec) {\n _inherits(CharacterMetadata, _CharacterMetadataRec);\n\n function CharacterMetadata() {\n _classCallCheck(this, CharacterMetadata);\n\n return _possibleConstructorReturn(this, _CharacterMetadataRec.apply(this, arguments));\n }\n\n CharacterMetadata.prototype.getStyle = function getStyle() {\n return this.get('style');\n };\n\n CharacterMetadata.prototype.getEntity = function getEntity() {\n return this.get('entity');\n };\n\n CharacterMetadata.prototype.hasStyle = function hasStyle(style) {\n return this.getStyle().includes(style);\n };\n\n CharacterMetadata.applyStyle = function applyStyle(record, style) {\n var withStyle = record.set('style', record.getStyle().add(style));\n return CharacterMetadata.create(withStyle);\n };\n\n CharacterMetadata.removeStyle = function removeStyle(record, style) {\n var withoutStyle = record.set('style', record.getStyle().remove(style));\n return CharacterMetadata.create(withoutStyle);\n };\n\n CharacterMetadata.applyEntity = function applyEntity(record, entityKey) {\n var withEntity = record.getEntity() === entityKey ? record : record.set('entity', entityKey);\n return CharacterMetadata.create(withEntity);\n };\n\n /**\n * Use this function instead of the `CharacterMetadata` constructor.\n * Since most content generally uses only a very small number of\n * style/entity permutations, we can reuse these objects as often as\n * possible.\n */\n\n\n CharacterMetadata.create = function create(config) {\n if (!config) {\n return EMPTY;\n }\n\n var defaultConfig = {\n style: EMPTY_SET,\n entity: null\n };\n\n // Fill in unspecified properties, if necessary.\n var configMap = Map(defaultConfig).merge(config);\n\n var existing = pool.get(configMap);\n if (existing) {\n return existing;\n }\n\n var newCharacter = new CharacterMetadata(configMap);\n pool = pool.set(configMap, newCharacter);\n return newCharacter;\n };\n\n return CharacterMetadata;\n}(CharacterMetadataRecord);\n\nvar EMPTY = new CharacterMetadata();\nvar pool = Map([[Map(defaultRecord), EMPTY]]);\n\nCharacterMetadata.EMPTY = EMPTY;\n\nmodule.exports = CharacterMetadata;"},{"id":5,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","name":"./lib/DraftModifier.js","index":9,"index2":26,"size":6887,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":23,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeTextWithStrategy.js","module":"./lib/removeTextWithStrategy.js","moduleName":"./lib/removeTextWithStrategy.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":66,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/RichTextEditorUtil.js","module":"./lib/RichTextEditorUtil.js","moduleName":"./lib/RichTextEditorUtil.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DraftModifier","loc":"26:20-46"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./DraftModifier","loc":"23:20-46"},{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./DraftModifier","loc":"16:20-46"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":123,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCut.js","module":"./lib/editOnCut.js","moduleName":"./lib/editOnCut.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":129,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SecondaryClipboard.js","module":"./lib/SecondaryClipboard.js","moduleName":"./lib/SecondaryClipboard.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":135,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandInsertNewline.js","module":"./lib/keyCommandInsertNewline.js","moduleName":"./lib/keyCommandInsertNewline.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":140,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandTransposeCharacters.js","module":"./lib/keyCommandTransposeCharacters.js","moduleName":"./lib/keyCommandTransposeCharacters.js","type":"cjs require","userRequest":"./DraftModifier","loc":"15:20-46"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./DraftModifier","loc":"18:20-46"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentStateInlineStyle = require('./ContentStateInlineStyle');\nvar Immutable = require('immutable');\n\nvar applyEntityToContentState = require('./applyEntityToContentState');\nvar getCharacterRemovalRange = require('./getCharacterRemovalRange');\nvar getContentStateFragment = require('./getContentStateFragment');\nvar gkx = require('./gkx');\nvar insertFragmentIntoContentState = require('./insertFragmentIntoContentState');\nvar insertTextIntoContentState = require('./insertTextIntoContentState');\nvar invariant = require('fbjs/lib/invariant');\nvar modifyBlockForContentState = require('./modifyBlockForContentState');\nvar removeEntitiesAtEdges = require('./removeEntitiesAtEdges');\nvar removeRangeFromContentState = require('./removeRangeFromContentState');\nvar splitBlockInContentState = require('./splitBlockInContentState');\n\nvar OrderedSet = Immutable.OrderedSet;\n\n/**\n * `DraftModifier` provides a set of convenience methods that apply\n * modifications to a `ContentState` object based on a target `SelectionState`.\n *\n * Any change to a `ContentState` should be decomposable into a series of\n * transaction functions that apply the required changes and return output\n * `ContentState` objects.\n *\n * These functions encapsulate some of the most common transaction sequences.\n */\n\nvar DraftModifier = {\n replaceText: function replaceText(contentState, rangeToReplace, text, inlineStyle, entityKey) {\n var withoutEntities = removeEntitiesAtEdges(contentState, rangeToReplace);\n var withoutText = removeRangeFromContentState(withoutEntities, rangeToReplace);\n\n var character = CharacterMetadata.create({\n style: inlineStyle || OrderedSet(),\n entity: entityKey || null\n });\n\n return insertTextIntoContentState(withoutText, withoutText.getSelectionAfter(), text, character);\n },\n\n insertText: function insertText(contentState, targetRange, text, inlineStyle, entityKey) {\n !targetRange.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Target range must be collapsed for `insertText`.') : invariant(false) : void 0;\n return DraftModifier.replaceText(contentState, targetRange, text, inlineStyle, entityKey);\n },\n\n moveText: function moveText(contentState, removalRange, targetRange) {\n var movedFragment = getContentStateFragment(contentState, removalRange);\n\n var afterRemoval = DraftModifier.removeRange(contentState, removalRange, 'backward');\n\n return DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);\n },\n\n replaceWithFragment: function replaceWithFragment(contentState, targetRange, fragment) {\n var withoutEntities = removeEntitiesAtEdges(contentState, targetRange);\n var withoutText = removeRangeFromContentState(withoutEntities, targetRange);\n\n return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment);\n },\n\n removeRange: function removeRange(contentState, rangeToRemove, removalDirection) {\n var startKey = void 0,\n endKey = void 0,\n startBlock = void 0,\n endBlock = void 0;\n if (rangeToRemove.getIsBackward()) {\n rangeToRemove = rangeToRemove.merge({\n anchorKey: rangeToRemove.getFocusKey(),\n anchorOffset: rangeToRemove.getFocusOffset(),\n focusKey: rangeToRemove.getAnchorKey(),\n focusOffset: rangeToRemove.getAnchorOffset(),\n isBackward: false\n });\n }\n startKey = rangeToRemove.getAnchorKey();\n endKey = rangeToRemove.getFocusKey();\n startBlock = contentState.getBlockForKey(startKey);\n endBlock = contentState.getBlockForKey(endKey);\n var startOffset = rangeToRemove.getStartOffset();\n var endOffset = rangeToRemove.getEndOffset();\n\n var startEntityKey = startBlock.getEntityAt(startOffset);\n var endEntityKey = endBlock.getEntityAt(endOffset - 1);\n\n // Check whether the selection state overlaps with a single entity.\n // If so, try to remove the appropriate substring of the entity text.\n if (startKey === endKey) {\n if (startEntityKey && startEntityKey === endEntityKey) {\n var _adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection);\n return removeRangeFromContentState(contentState, _adjustedRemovalRange);\n }\n }\n var adjustedRemovalRange = rangeToRemove;\n if (gkx('draft_segmented_entities_behavior')) {\n // Adjust the selection to properly delete segemented and immutable\n // entities\n adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection);\n }\n\n var withoutEntities = removeEntitiesAtEdges(contentState, adjustedRemovalRange);\n return removeRangeFromContentState(withoutEntities, adjustedRemovalRange);\n },\n\n splitBlock: function splitBlock(contentState, selectionState) {\n var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);\n var withoutText = removeRangeFromContentState(withoutEntities, selectionState);\n\n return splitBlockInContentState(withoutText, withoutText.getSelectionAfter());\n },\n\n applyInlineStyle: function applyInlineStyle(contentState, selectionState, inlineStyle) {\n return ContentStateInlineStyle.add(contentState, selectionState, inlineStyle);\n },\n\n removeInlineStyle: function removeInlineStyle(contentState, selectionState, inlineStyle) {\n return ContentStateInlineStyle.remove(contentState, selectionState, inlineStyle);\n },\n\n setBlockType: function setBlockType(contentState, selectionState, blockType) {\n return modifyBlockForContentState(contentState, selectionState, function (block) {\n return block.merge({ type: blockType, depth: 0 });\n });\n },\n\n setBlockData: function setBlockData(contentState, selectionState, blockData) {\n return modifyBlockForContentState(contentState, selectionState, function (block) {\n return block.merge({ data: blockData });\n });\n },\n\n mergeBlockData: function mergeBlockData(contentState, selectionState, blockData) {\n return modifyBlockForContentState(contentState, selectionState, function (block) {\n return block.merge({ data: block.getData().merge(blockData) });\n });\n },\n\n applyEntity: function applyEntity(contentState, selectionState, entityKey) {\n var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);\n return applyEntityToContentState(withoutEntities, selectionState, entityKey);\n }\n};\n\nmodule.exports = DraftModifier;"},{"id":6,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlockNode.js","name":"./lib/ContentBlockNode.js","index":8,"index2":6,"size":5010,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","issuerId":70,"issuerName":"./lib/AtomicBlockUtils.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"24:23-52"},{"moduleId":41,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/randomizeBlockMapKeys.js","module":"./lib/randomizeBlockMapKeys.js","moduleName":"./lib/randomizeBlockMapKeys.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"15:23-52"},{"moduleId":44,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getNextDelimiterBlockKey.js","module":"./lib/getNextDelimiterBlockKey.js","moduleName":"./lib/getNextDelimiterBlockKey.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"18:23-52"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"24:23-52"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"26:23-52"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"22:23-52"},{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"16:23-52"},{"moduleId":80,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeRangeFromContentState.js","module":"./lib/removeRangeFromContentState.js","moduleName":"./lib/removeRangeFromContentState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"15:23-52"},{"moduleId":81,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/splitBlockInContentState.js","module":"./lib/splitBlockInContentState.js","moduleName":"./lib/splitBlockInContentState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"15:23-52"},{"moduleId":85,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","module":"./lib/moveBlockInContentState.js","moduleName":"./lib/moveBlockInContentState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"15:23-52"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"21:23-52"},{"moduleId":150,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","module":"./lib/convertFromDraftStateToRaw.js","moduleName":"./lib/convertFromDraftStateToRaw.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"20:23-52"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./ContentBlockNode","loc":"20:23-52"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This file is a fork of ContentBlock adding support for nesting references by\n * providing links to children, parent, prevSibling, and nextSibling.\n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar Immutable = require('immutable');\n\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n Map = Immutable.Map,\n OrderedSet = Immutable.OrderedSet,\n Record = Immutable.Record,\n Repeat = Immutable.Repeat;\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n parent: null,\n characterList: List(),\n data: Map(),\n depth: 0,\n key: '',\n text: '',\n type: 'unstyled',\n children: List(),\n prevSibling: null,\n nextSibling: null\n};\n\nvar haveEqualStyle = function haveEqualStyle(charA, charB) {\n return charA.getStyle() === charB.getStyle();\n};\n\nvar haveEqualEntity = function haveEqualEntity(charA, charB) {\n return charA.getEntity() === charB.getEntity();\n};\n\nvar decorateCharacterList = function decorateCharacterList(config) {\n if (!config) {\n return config;\n }\n\n var characterList = config.characterList,\n text = config.text;\n\n\n if (text && !characterList) {\n config.characterList = List(Repeat(CharacterMetadata.EMPTY, text.length));\n }\n\n return config;\n};\n\nvar ContentBlockNode = function (_Record) {\n _inherits(ContentBlockNode, _Record);\n\n function ContentBlockNode() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultRecord;\n\n _classCallCheck(this, ContentBlockNode);\n\n return _possibleConstructorReturn(this, _Record.call(this, decorateCharacterList(props)));\n }\n\n ContentBlockNode.prototype.getKey = function getKey() {\n return this.get('key');\n };\n\n ContentBlockNode.prototype.getType = function getType() {\n return this.get('type');\n };\n\n ContentBlockNode.prototype.getText = function getText() {\n return this.get('text');\n };\n\n ContentBlockNode.prototype.getCharacterList = function getCharacterList() {\n return this.get('characterList');\n };\n\n ContentBlockNode.prototype.getLength = function getLength() {\n return this.getText().length;\n };\n\n ContentBlockNode.prototype.getDepth = function getDepth() {\n return this.get('depth');\n };\n\n ContentBlockNode.prototype.getData = function getData() {\n return this.get('data');\n };\n\n ContentBlockNode.prototype.getInlineStyleAt = function getInlineStyleAt(offset) {\n var character = this.getCharacterList().get(offset);\n return character ? character.getStyle() : EMPTY_SET;\n };\n\n ContentBlockNode.prototype.getEntityAt = function getEntityAt(offset) {\n var character = this.getCharacterList().get(offset);\n return character ? character.getEntity() : null;\n };\n\n ContentBlockNode.prototype.getChildKeys = function getChildKeys() {\n return this.get('children');\n };\n\n ContentBlockNode.prototype.getParentKey = function getParentKey() {\n return this.get('parent');\n };\n\n ContentBlockNode.prototype.getPrevSiblingKey = function getPrevSiblingKey() {\n return this.get('prevSibling');\n };\n\n ContentBlockNode.prototype.getNextSiblingKey = function getNextSiblingKey() {\n return this.get('nextSibling');\n };\n\n ContentBlockNode.prototype.findStyleRanges = function findStyleRanges(filterFn, callback) {\n findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);\n };\n\n ContentBlockNode.prototype.findEntityRanges = function findEntityRanges(filterFn, callback) {\n findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);\n };\n\n return ContentBlockNode;\n}(Record(defaultRecord));\n\nmodule.exports = ContentBlockNode;"},{"id":7,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/gkx.js","name":"./lib/gkx.js","index":21,"index2":18,"size":503,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./gkx","loc":"22:10-26"},{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./gkx","loc":"30:10-26"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./gkx","loc":"37:10-26"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./gkx","loc":"40:10-26"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./gkx","loc":"38:10-26"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./gkx","loc":"29:10-26"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./gkx","loc":"46:10-26"},{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./gkx","loc":"20:10-26"},{"moduleId":89,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","module":"./lib/DraftEditorContents.react.js","moduleName":"./lib/DraftEditorContents.react.js","type":"cjs require","userRequest":"./gkx","loc":"15:10-26"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"./gkx","loc":"21:10-26"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./gkx","loc":"28:10-26"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./gkx","loc":"31:10-26"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict\n */\n\n'use strict';\n\nmodule.exports = function (name) {\n if (typeof window !== 'undefined' && window.__DRAFT_GKX) {\n return !!window.__DRAFT_GKX[name];\n }\n return false;\n};"},{"id":8,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/nullthrows.js","name":"./node_modules/fbjs/lib/nullthrows.js","index":41,"index2":37,"size":372,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"39:17-47"},{"moduleId":57,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getUpdatedSelectionState.js","module":"./lib/getUpdatedSelectionState.js","moduleName":"./lib/getUpdatedSelectionState.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"17:17-47"},{"moduleId":60,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","module":"./lib/getDraftEditorSelectionWithNodes.js","moduleName":"./lib/getDraftEditorSelectionWithNodes.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"19:17-47"},{"moduleId":66,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/RichTextEditorUtil.js","module":"./lib/RichTextEditorUtil.js","moduleName":"./lib/RichTextEditorUtil.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"20:17-47"},{"moduleId":83,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorBidiService.js","module":"./lib/EditorBidiService.js","moduleName":"./lib/EditorBidiService.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"18:17-47"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"48:17-47"},{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"35:17-47"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"32:17-47"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"23:17-47"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"22:17-47"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"22:17-47"},{"moduleId":129,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SecondaryClipboard.js","module":"./lib/SecondaryClipboard.js","moduleName":"./lib/SecondaryClipboard.js","type":"cjs require","userRequest":"fbjs/lib/nullthrows","loc":"19:17-47"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar nullthrows = function nullthrows(x) {\n if (x != null) {\n return x;\n }\n throw new Error(\"Got unexpected null or undefined\");\n};\n\nmodule.exports = nullthrows;"},{"id":9,"identifier":"external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","name":"external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","index":45,"index2":43,"size":42,"cacheable":false,"built":false,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","issuerId":26,"issuerName":"./lib/DefaultDraftBlockRenderMap.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":26,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","module":"./lib/DefaultDraftBlockRenderMap.js","moduleName":"./lib/DefaultDraftBlockRenderMap.js","type":"cjs require","userRequest":"react","loc":"18:12-28"},{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"react","loc":"24:12-28"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"react","loc":"27:12-28"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"react","loc":"35:12-28"},{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"react","loc":"33:12-28"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"react","loc":"34:12-28"},{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"react","loc":"28:12-28"},{"moduleId":93,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","module":"./lib/DraftEditorDecoratedLeaves.react.js","moduleName":"./lib/DraftEditorDecoratedLeaves.react.js","type":"cjs require","userRequest":"react","loc":"29:12-28"},{"moduleId":94,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorTextNode.react.js","module":"./lib/DraftEditorTextNode.react.js","moduleName":"./lib/DraftEditorTextNode.react.js","type":"cjs require","userRequest":"react","loc":"21:12-28"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"react","loc":"28:12-28"},{"moduleId":148,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorPlaceholder.react.js","module":"./lib/DraftEditorPlaceholder.react.js","moduleName":"./lib/DraftEditorPlaceholder.react.js","type":"cjs require","userRequest":"react","loc":"21:12-28"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2},{"id":10,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/generateRandomKey.js","name":"./lib/generateRandomKey.js","index":19,"index2":14,"size":676,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"29:24-54"},{"moduleId":41,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/randomizeBlockMapKeys.js","module":"./lib/randomizeBlockMapKeys.js","moduleName":"./lib/randomizeBlockMapKeys.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"18:24-54"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"35:24-54"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"38:24-54"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"35:24-54"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"28:24-54"},{"moduleId":81,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/splitBlockInContentState.js","module":"./lib/splitBlockInContentState.js","moduleName":"./lib/splitBlockInContentState.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"18:24-54"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"43:24-54"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"26:24-54"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./generateRandomKey","loc":"30:24-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict\n */\n\n'use strict';\n\nvar seenKeys = {};\nvar MULTIPLIER = Math.pow(2, 24);\n\nfunction generateRandomKey() {\n var key = void 0;\n while (key === undefined || seenKeys.hasOwnProperty(key) || !isNaN(+key)) {\n key = Math.floor(Math.random() * MULTIPLIER).toString(32);\n }\n seenKeys[key] = true;\n return key;\n}\n\nmodule.exports = generateRandomKey;"},{"id":11,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","name":"./node_modules/fbjs/lib/UserAgent.js","index":63,"index2":61,"size":6165,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":38,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/KeyBindingUtil.js","module":"./lib/KeyBindingUtil.js","moduleName":"./lib/KeyBindingUtil.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"15:16-45"},{"moduleId":40,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getSafeBodyFromHTML.js","module":"./lib/getSafeBodyFromHTML.js","moduleName":"./lib/getSafeBodyFromHTML.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"15:16-45"},{"moduleId":59,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangeClientRects.js","module":"./lib/getRangeClientRects.js","moduleName":"./lib/getRangeClientRects.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"15:16-45"},{"moduleId":67,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDefaultKeyBinding.js","module":"./lib/getDefaultKeyBinding.js","moduleName":"./lib/getDefaultKeyBinding.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"17:16-45"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"39:16-45"},{"moduleId":94,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorTextNode.react.js","module":"./lib/DraftEditorTextNode.react.js","moduleName":"./lib/DraftEditorTextNode.react.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"23:16-45"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"17:16-45"},{"moduleId":126,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnFocus.js","module":"./lib/editOnFocus.js","moduleName":"./lib/editOnFocus.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"16:16-45"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"18:16-45"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"fbjs/lib/UserAgent","loc":"20:16-45"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar UserAgentData = require('./UserAgentData');\nvar VersionRange = require('./VersionRange');\n\nvar mapObject = require('./mapObject');\nvar memoizeStringOnly = require('./memoizeStringOnly');\n\n/**\n * Checks to see whether `name` and `version` satisfy `query`.\n *\n * @param {string} name Name of the browser, device, engine or platform\n * @param {?string} version Version of the browser, engine or platform\n * @param {string} query Query of form \"Name [range expression]\"\n * @param {?function} normalizer Optional pre-processor for range expression\n * @return {boolean}\n */\nfunction compare(name, version, query, normalizer) {\n // check for exact match with no version\n if (name === query) {\n return true;\n }\n\n // check for non-matching names\n if (!query.startsWith(name)) {\n return false;\n }\n\n // full comparison with version\n var range = query.slice(name.length);\n if (version) {\n range = normalizer ? normalizer(range) : range;\n return VersionRange.contains(range, version);\n }\n\n return false;\n}\n\n/**\n * Normalizes `version` by stripping any \"NT\" prefix, but only on the Windows\n * platform.\n *\n * Mimics the stripping performed by the `UserAgentWindowsPlatform` PHP class.\n *\n * @param {string} version\n * @return {string}\n */\nfunction normalizePlatformVersion(version) {\n if (UserAgentData.platformName === 'Windows') {\n return version.replace(/^\\s*NT/, '');\n }\n\n return version;\n}\n\n/**\n * Provides client-side access to the authoritative PHP-generated User Agent\n * information supplied by the server.\n */\nvar UserAgent = {\n /**\n * Check if the User Agent browser matches `query`.\n *\n * `query` should be a string like \"Chrome\" or \"Chrome > 33\".\n *\n * Valid browser names include:\n *\n * - ACCESS NetFront\n * - AOL\n * - Amazon Silk\n * - Android\n * - BlackBerry\n * - BlackBerry PlayBook\n * - Chrome\n * - Chrome for iOS\n * - Chrome frame\n * - Facebook PHP SDK\n * - Facebook for iOS\n * - Firefox\n * - IE\n * - IE Mobile\n * - Mobile Safari\n * - Motorola Internet Browser\n * - Nokia\n * - Openwave Mobile Browser\n * - Opera\n * - Opera Mini\n * - Opera Mobile\n * - Safari\n * - UIWebView\n * - Unknown\n * - webOS\n * - etc...\n *\n * An authoritative list can be found in the PHP `BrowserDetector` class and\n * related classes in the same file (see calls to `new UserAgentBrowser` here:\n * https://fburl.com/50728104).\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"Name [range expression]\"\n * @return {boolean}\n */\n isBrowser: function isBrowser(query) {\n return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query);\n },\n\n\n /**\n * Check if the User Agent browser uses a 32 or 64 bit architecture.\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"32\" or \"64\".\n * @return {boolean}\n */\n isBrowserArchitecture: function isBrowserArchitecture(query) {\n return compare(UserAgentData.browserArchitecture, null, query);\n },\n\n\n /**\n * Check if the User Agent device matches `query`.\n *\n * `query` should be a string like \"iPhone\" or \"iPad\".\n *\n * Valid device names include:\n *\n * - Kindle\n * - Kindle Fire\n * - Unknown\n * - iPad\n * - iPhone\n * - iPod\n * - etc...\n *\n * An authoritative list can be found in the PHP `DeviceDetector` class and\n * related classes in the same file (see calls to `new UserAgentDevice` here:\n * https://fburl.com/50728332).\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"Name\"\n * @return {boolean}\n */\n isDevice: function isDevice(query) {\n return compare(UserAgentData.deviceName, null, query);\n },\n\n\n /**\n * Check if the User Agent rendering engine matches `query`.\n *\n * `query` should be a string like \"WebKit\" or \"WebKit >= 537\".\n *\n * Valid engine names include:\n *\n * - Gecko\n * - Presto\n * - Trident\n * - WebKit\n * - etc...\n *\n * An authoritative list can be found in the PHP `RenderingEngineDetector`\n * class related classes in the same file (see calls to `new\n * UserAgentRenderingEngine` here: https://fburl.com/50728617).\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"Name [range expression]\"\n * @return {boolean}\n */\n isEngine: function isEngine(query) {\n return compare(UserAgentData.engineName, UserAgentData.engineVersion, query);\n },\n\n\n /**\n * Check if the User Agent platform matches `query`.\n *\n * `query` should be a string like \"Windows\" or \"iOS 5 - 6\".\n *\n * Valid platform names include:\n *\n * - Android\n * - BlackBerry OS\n * - Java ME\n * - Linux\n * - Mac OS X\n * - Mac OS X Calendar\n * - Mac OS X Internet Account\n * - Symbian\n * - SymbianOS\n * - Windows\n * - Windows Mobile\n * - Windows Phone\n * - iOS\n * - iOS Facebook Integration Account\n * - iOS Facebook Social Sharing UI\n * - webOS\n * - Chrome OS\n * - etc...\n *\n * An authoritative list can be found in the PHP `PlatformDetector` class and\n * related classes in the same file (see calls to `new UserAgentPlatform`\n * here: https://fburl.com/50729226).\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"Name [range expression]\"\n * @return {boolean}\n */\n isPlatform: function isPlatform(query) {\n return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion);\n },\n\n\n /**\n * Check if the User Agent platform is a 32 or 64 bit architecture.\n *\n * @note Function results are memoized\n *\n * @param {string} query Query of the form \"32\" or \"64\".\n * @return {boolean}\n */\n isPlatformArchitecture: function isPlatformArchitecture(query) {\n return compare(UserAgentData.platformArchitecture, null, query);\n }\n};\n\nmodule.exports = mapObject(UserAgent, memoizeStringOnly);"},{"id":12,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/webpack/buildin/global.js","name":"(webpack)/buildin/global.js","index":71,"index2":63,"size":509,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getTextContentFromFiles.js","issuerId":56,"issuerName":"./lib/getTextContentFromFiles.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":56,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getTextContentFromFiles.js","module":"./lib/getTextContentFromFiles.js","moduleName":"./lib/getTextContentFromFiles.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":101,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","module":"./lib/setDraftEditorSelection.js","moduleName":"./lib/setDraftEditorSelection.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":117,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/setImmediate.js","module":"./node_modules/fbjs/lib/setImmediate.js","moduleName":"./node_modules/fbjs/lib/setImmediate.js","type":"cjs require","userRequest":"global","loc":"1:0-44"},{"moduleId":118,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/setimmediate/setImmediate.js","module":"./node_modules/setimmediate/setImmediate.js","moduleName":"./node_modules/setimmediate/setImmediate.js","type":"cjs require","userRequest":"global","loc":"1:0-41"},{"moduleId":120,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","module":"./lib/editOnBlur.js","moduleName":"./lib/editOnBlur.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":130,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","module":"./lib/keyCommandBackspaceToStartOfLine.js","moduleName":"./lib/keyCommandBackspaceToStartOfLine.js","type":"cjs require","userRequest":"global","loc":"1:0-54"},{"moduleId":147,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelection.js","module":"./lib/getDraftEditorSelection.js","moduleName":"./lib/getDraftEditorSelection.js","type":"cjs require","userRequest":"global","loc":"1:0-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n"},{"id":13,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlock.js","name":"./lib/ContentBlock.js","index":6,"index2":5,"size":4232,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./ContentBlock","loc":"23:19-44"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./ContentBlock","loc":"23:19-44"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./ContentBlock","loc":"25:19-44"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./ContentBlock","loc":"19:19-44"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./ContentBlock","loc":"21:19-44"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./ContentBlock","loc":"20:19-44"},{"moduleId":150,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","module":"./lib/convertFromDraftStateToRaw.js","moduleName":"./lib/convertFromDraftStateToRaw.js","type":"cjs require","userRequest":"./ContentBlock","loc":"19:19-44"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./ContentBlock","loc":"19:19-44"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar Immutable = require('immutable');\n\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n Map = Immutable.Map,\n OrderedSet = Immutable.OrderedSet,\n Record = Immutable.Record,\n Repeat = Immutable.Repeat;\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n key: '',\n type: 'unstyled',\n text: '',\n characterList: List(),\n depth: 0,\n data: Map()\n};\n\nvar ContentBlockRecord = Record(defaultRecord);\n\nvar decorateCharacterList = function decorateCharacterList(config) {\n if (!config) {\n return config;\n }\n\n var characterList = config.characterList,\n text = config.text;\n\n\n if (text && !characterList) {\n config.characterList = List(Repeat(CharacterMetadata.EMPTY, text.length));\n }\n\n return config;\n};\n\nvar ContentBlock = function (_ContentBlockRecord) {\n _inherits(ContentBlock, _ContentBlockRecord);\n\n function ContentBlock(config) {\n _classCallCheck(this, ContentBlock);\n\n return _possibleConstructorReturn(this, _ContentBlockRecord.call(this, decorateCharacterList(config)));\n }\n\n ContentBlock.prototype.getKey = function getKey() {\n return this.get('key');\n };\n\n ContentBlock.prototype.getType = function getType() {\n return this.get('type');\n };\n\n ContentBlock.prototype.getText = function getText() {\n return this.get('text');\n };\n\n ContentBlock.prototype.getCharacterList = function getCharacterList() {\n return this.get('characterList');\n };\n\n ContentBlock.prototype.getLength = function getLength() {\n return this.getText().length;\n };\n\n ContentBlock.prototype.getDepth = function getDepth() {\n return this.get('depth');\n };\n\n ContentBlock.prototype.getData = function getData() {\n return this.get('data');\n };\n\n ContentBlock.prototype.getInlineStyleAt = function getInlineStyleAt(offset) {\n var character = this.getCharacterList().get(offset);\n return character ? character.getStyle() : EMPTY_SET;\n };\n\n ContentBlock.prototype.getEntityAt = function getEntityAt(offset) {\n var character = this.getCharacterList().get(offset);\n return character ? character.getEntity() : null;\n };\n\n /**\n * Execute a callback for every contiguous range of styles within the block.\n */\n\n\n ContentBlock.prototype.findStyleRanges = function findStyleRanges(filterFn, callback) {\n findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);\n };\n\n /**\n * Execute a callback for every contiguous range of entities within the block.\n */\n\n\n ContentBlock.prototype.findEntityRanges = function findEntityRanges(filterFn, callback) {\n findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);\n };\n\n return ContentBlock;\n}(ContentBlockRecord);\n\nfunction haveEqualStyle(charA, charB) {\n return charA.getStyle() === charB.getStyle();\n}\n\nfunction haveEqualEntity(charA, charB) {\n return charA.getEntity() === charB.getEntity();\n}\n\nmodule.exports = ContentBlock;"},{"id":14,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/cx.js","name":"./node_modules/fbjs/lib/cx.js","index":46,"index2":44,"size":1351,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","issuerId":26,"issuerName":"./lib/DefaultDraftBlockRenderMap.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":26,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","module":"./lib/DefaultDraftBlockRenderMap.js","moduleName":"./lib/DefaultDraftBlockRenderMap.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"20:9-31"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"34:9-31"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"34:9-31"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"37:9-31"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"41:9-31"},{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"30:9-31"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"30:9-31"},{"moduleId":148,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorPlaceholder.react.js","module":"./lib/DraftEditorPlaceholder.react.js","moduleName":"./lib/DraftEditorPlaceholder.react.js","type":"cjs require","userRequest":"fbjs/lib/cx","loc":"23:9-31"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * This function is used to mark string literals representing CSS class names\n * so that they can be transformed statically. This allows for modularization\n * and minification of CSS class names.\n *\n * In static_upstream, this function is actually implemented, but it should\n * eventually be replaced with something more descriptive, and the transform\n * that is used in the main stack should be ported for use elsewhere.\n *\n * @param string|object className to modularize, or an object of key/values.\n * In the object case, the values are conditions that\n * determine if the className keys should be included.\n * @param [string ...] Variable list of classNames in the string case.\n * @return string Renderable space-separated CSS className.\n */\nfunction cx(classNames) {\n if (typeof classNames == 'object') {\n return Object.keys(classNames).filter(function (className) {\n return classNames[className];\n }).map(replace).join(' ');\n }\n return Array.prototype.map.call(arguments, replace).join(' ');\n}\n\nfunction replace(str) {\n return str.replace(/\\//g, '-');\n}\n\nmodule.exports = cx;"},{"id":15,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftOffsetKey.js","name":"./lib/DraftOffsetKey.js","index":59,"index2":52,"size":943,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"26:21-48"},{"moduleId":57,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getUpdatedSelectionState.js","module":"./lib/getUpdatedSelectionState.js","moduleName":"./lib/getUpdatedSelectionState.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"15:21-48"},{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"31:21-48"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"31:21-48"},{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"26:21-48"},{"moduleId":93,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","module":"./lib/DraftEditorDecoratedLeaves.react.js","moduleName":"./lib/DraftEditorDecoratedLeaves.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"28:21-48"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"26:21-48"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"./DraftOffsetKey","loc":"16:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar KEY_DELIMITER = '-';\n\nvar DraftOffsetKey = {\n encode: function encode(blockKey, decoratorKey, leafKey) {\n return blockKey + KEY_DELIMITER + decoratorKey + KEY_DELIMITER + leafKey;\n },\n\n decode: function decode(offsetKey) {\n var _offsetKey$split = offsetKey.split(KEY_DELIMITER),\n blockKey = _offsetKey$split[0],\n decoratorKey = _offsetKey$split[1],\n leafKey = _offsetKey$split[2];\n\n return {\n blockKey: blockKey,\n decoratorKey: parseInt(decoratorKey, 10),\n leafKey: parseInt(leafKey, 10)\n };\n }\n};\n\nmodule.exports = DraftOffsetKey;"},{"id":16,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeUtils.js","name":"./node_modules/fbjs/lib/UnicodeUtils.js","index":118,"index2":112,"size":6136,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/encodeEntityRanges.js","issuerId":151,"issuerName":"./lib/encodeEntityRanges.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":131,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/expandRangeToStartOfLine.js","module":"./lib/expandRangeToStartOfLine.js","moduleName":"./lib/expandRangeToStartOfLine.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"15:19-51"},{"moduleId":138,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainBackspace.js","module":"./lib/keyCommandPlainBackspace.js","moduleName":"./lib/keyCommandPlainBackspace.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"16:19-51"},{"moduleId":139,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainDelete.js","module":"./lib/keyCommandPlainDelete.js","moduleName":"./lib/keyCommandPlainDelete.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"16:19-51"},{"moduleId":151,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/encodeEntityRanges.js","module":"./lib/encodeEntityRanges.js","moduleName":"./lib/encodeEntityRanges.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"16:19-51"},{"moduleId":152,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/encodeInlineStyleRanges.js","module":"./lib/encodeInlineStyleRanges.js","moduleName":"./lib/encodeInlineStyleRanges.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"15:19-51"},{"moduleId":156,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/decodeEntityRanges.js","module":"./lib/decodeEntityRanges.js","moduleName":"./lib/decodeEntityRanges.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"15:19-51"},{"moduleId":157,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/decodeInlineStyleRanges.js","module":"./lib/decodeInlineStyleRanges.js","moduleName":"./lib/decodeInlineStyleRanges.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeUtils","loc":"18:19-51"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/**\n * Unicode-enabled replacesments for basic String functions.\n *\n * All the functions in this module assume that the input string is a valid\n * UTF-16 encoding of a Unicode sequence. If it's not the case, the behavior\n * will be undefined.\n *\n * WARNING: Since this module is typechecks-enforced, you may find new bugs\n * when replacing normal String functions with ones provided here.\n */\n\n'use strict';\n\nvar invariant = require('./invariant');\n\n// These two ranges are consecutive so anything in [HIGH_START, LOW_END] is a\n// surrogate code unit.\nvar SURROGATE_HIGH_START = 0xD800;\nvar SURROGATE_HIGH_END = 0xDBFF;\nvar SURROGATE_LOW_START = 0xDC00;\nvar SURROGATE_LOW_END = 0xDFFF;\nvar SURROGATE_UNITS_REGEX = /[\\uD800-\\uDFFF]/;\n\n/**\n * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF]\n * @return {boolean} Whether code-unit is in a surrogate (hi/low) range\n */\nfunction isCodeUnitInSurrogateRange(codeUnit) {\n return SURROGATE_HIGH_START <= codeUnit && codeUnit <= SURROGATE_LOW_END;\n}\n\n/**\n * Returns whether the two characters starting at `index` form a surrogate pair.\n * For example, given the string s = \"\\uD83D\\uDE0A\", (s, 0) returns true and\n * (s, 1) returns false.\n *\n * @param {string} str\n * @param {number} index\n * @return {boolean}\n */\nfunction isSurrogatePair(str, index) {\n !(0 <= index && index < str.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isSurrogatePair: Invalid index %s for string length %s.', index, str.length) : invariant(false) : void 0;\n if (index + 1 === str.length) {\n return false;\n }\n var first = str.charCodeAt(index);\n var second = str.charCodeAt(index + 1);\n return SURROGATE_HIGH_START <= first && first <= SURROGATE_HIGH_END && SURROGATE_LOW_START <= second && second <= SURROGATE_LOW_END;\n}\n\n/**\n * @param {string} str Non-empty string\n * @return {boolean} True if the input includes any surrogate code units\n */\nfunction hasSurrogateUnit(str) {\n return SURROGATE_UNITS_REGEX.test(str);\n}\n\n/**\n * Return the length of the original Unicode character at given position in the\n * String by looking into the UTF-16 code unit; that is equal to 1 for any\n * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and\n * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact\n * representing non-BMP characters ([U+10000..U+10FFFF]).\n *\n * Examples:\n * - '\\u0020' => 1\n * - '\\u3020' => 1\n * - '\\uD835' => 2\n * - '\\uD835\\uDDEF' => 2\n * - '\\uDDEF' => 2\n *\n * @param {string} str Non-empty string\n * @param {number} pos Position in the string to look for one code unit\n * @return {number} Number 1 or 2\n */\nfunction getUTF16Length(str, pos) {\n return 1 + isCodeUnitInSurrogateRange(str.charCodeAt(pos));\n}\n\n/**\n * Fully Unicode-enabled replacement for String#length\n *\n * @param {string} str Valid Unicode string\n * @return {number} The number of Unicode characters in the string\n */\nfunction strlen(str) {\n // Call the native functions if there's no surrogate char\n if (!hasSurrogateUnit(str)) {\n return str.length;\n }\n\n var len = 0;\n for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) {\n len++;\n }\n return len;\n}\n\n/**\n * Fully Unicode-enabled replacement for String#substr()\n *\n * @param {string} str Valid Unicode string\n * @param {number} start Location in Unicode sequence to begin extracting\n * @param {?number} length The number of Unicode characters to extract\n * (default: to the end of the string)\n * @return {string} Extracted sub-string\n */\nfunction substr(str, start, length) {\n start = start || 0;\n length = length === undefined ? Infinity : length || 0;\n\n // Call the native functions if there's no surrogate char\n if (!hasSurrogateUnit(str)) {\n return str.substr(start, length);\n }\n\n // Obvious cases\n var size = str.length;\n if (size <= 0 || start > size || length <= 0) {\n return '';\n }\n\n // Find the actual starting position\n var posA = 0;\n if (start > 0) {\n for (; start > 0 && posA < size; start--) {\n posA += getUTF16Length(str, posA);\n }\n if (posA >= size) {\n return '';\n }\n } else if (start < 0) {\n for (posA = size; start < 0 && 0 < posA; start++) {\n posA -= getUTF16Length(str, posA - 1);\n }\n if (posA < 0) {\n posA = 0;\n }\n }\n\n // Find the actual ending position\n var posB = size;\n if (length < size) {\n for (posB = posA; length > 0 && posB < size; length--) {\n posB += getUTF16Length(str, posB);\n }\n }\n\n return str.substring(posA, posB);\n}\n\n/**\n * Fully Unicode-enabled replacement for String#substring()\n *\n * @param {string} str Valid Unicode string\n * @param {number} start Location in Unicode sequence to begin extracting\n * @param {?number} end Location in Unicode sequence to end extracting\n * (default: end of the string)\n * @return {string} Extracted sub-string\n */\nfunction substring(str, start, end) {\n start = start || 0;\n end = end === undefined ? Infinity : end || 0;\n\n if (start < 0) {\n start = 0;\n }\n if (end < 0) {\n end = 0;\n }\n\n var length = Math.abs(end - start);\n start = start < end ? start : end;\n return substr(str, start, length);\n}\n\n/**\n * Get a list of Unicode code-points from a String\n *\n * @param {string} str Valid Unicode string\n * @return {array} A list of code-points in [0..0x10FFFF]\n */\nfunction getCodePoints(str) {\n var codePoints = [];\n for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) {\n codePoints.push(str.codePointAt(pos));\n }\n return codePoints;\n}\n\nvar UnicodeUtils = {\n getCodePoints: getCodePoints,\n getUTF16Length: getUTF16Length,\n hasSurrogateUnit: hasSurrogateUnit,\n isCodeUnitInSurrogateRange: isCodeUnitInSurrogateRange,\n isSurrogatePair: isSurrogatePair,\n strlen: strlen,\n substring: substring,\n substr: substr\n};\n\nmodule.exports = UnicodeUtils;"},{"id":17,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SelectionState.js","name":"./lib/SelectionState.js","index":35,"index2":31,"size":4626,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"./SelectionState","loc":"25:21-48"},{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./SelectionState","loc":"27:21-48"},{"moduleId":66,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/RichTextEditorUtil.js","module":"./lib/RichTextEditorUtil.js","moduleName":"./lib/RichTextEditorUtil.js","type":"cjs require","userRequest":"./SelectionState","loc":"17:21-48"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./SelectionState","loc":"31:21-48"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./SelectionState","loc":"26:21-48"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./SelectionState","loc":"25:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar Immutable = require('immutable');\n\nvar Record = Immutable.Record;\n\n\nvar defaultRecord = {\n anchorKey: '',\n anchorOffset: 0,\n focusKey: '',\n focusOffset: 0,\n isBackward: false,\n hasFocus: false\n};\n\nvar SelectionStateRecord = Record(defaultRecord);\n\nvar SelectionState = function (_SelectionStateRecord) {\n _inherits(SelectionState, _SelectionStateRecord);\n\n function SelectionState() {\n _classCallCheck(this, SelectionState);\n\n return _possibleConstructorReturn(this, _SelectionStateRecord.apply(this, arguments));\n }\n\n SelectionState.prototype.serialize = function serialize() {\n return 'Anchor: ' + this.getAnchorKey() + ':' + this.getAnchorOffset() + ', ' + 'Focus: ' + this.getFocusKey() + ':' + this.getFocusOffset() + ', ' + 'Is Backward: ' + String(this.getIsBackward()) + ', ' + 'Has Focus: ' + String(this.getHasFocus());\n };\n\n SelectionState.prototype.getAnchorKey = function getAnchorKey() {\n return this.get('anchorKey');\n };\n\n SelectionState.prototype.getAnchorOffset = function getAnchorOffset() {\n return this.get('anchorOffset');\n };\n\n SelectionState.prototype.getFocusKey = function getFocusKey() {\n return this.get('focusKey');\n };\n\n SelectionState.prototype.getFocusOffset = function getFocusOffset() {\n return this.get('focusOffset');\n };\n\n SelectionState.prototype.getIsBackward = function getIsBackward() {\n return this.get('isBackward');\n };\n\n SelectionState.prototype.getHasFocus = function getHasFocus() {\n return this.get('hasFocus');\n };\n\n /**\n * Return whether the specified range overlaps with an edge of the\n * SelectionState.\n */\n\n\n SelectionState.prototype.hasEdgeWithin = function hasEdgeWithin(blockKey, start, end) {\n var anchorKey = this.getAnchorKey();\n var focusKey = this.getFocusKey();\n\n if (anchorKey === focusKey && anchorKey === blockKey) {\n var selectionStart = this.getStartOffset();\n var selectionEnd = this.getEndOffset();\n return start <= selectionEnd && selectionStart <= end;\n }\n\n if (blockKey !== anchorKey && blockKey !== focusKey) {\n return false;\n }\n\n var offsetToCheck = blockKey === anchorKey ? this.getAnchorOffset() : this.getFocusOffset();\n\n return start <= offsetToCheck && end >= offsetToCheck;\n };\n\n SelectionState.prototype.isCollapsed = function isCollapsed() {\n return this.getAnchorKey() === this.getFocusKey() && this.getAnchorOffset() === this.getFocusOffset();\n };\n\n SelectionState.prototype.getStartKey = function getStartKey() {\n return this.getIsBackward() ? this.getFocusKey() : this.getAnchorKey();\n };\n\n SelectionState.prototype.getStartOffset = function getStartOffset() {\n return this.getIsBackward() ? this.getFocusOffset() : this.getAnchorOffset();\n };\n\n SelectionState.prototype.getEndKey = function getEndKey() {\n return this.getIsBackward() ? this.getAnchorKey() : this.getFocusKey();\n };\n\n SelectionState.prototype.getEndOffset = function getEndOffset() {\n return this.getIsBackward() ? this.getAnchorOffset() : this.getFocusOffset();\n };\n\n SelectionState.createEmpty = function createEmpty(key) {\n return new SelectionState({\n anchorKey: key,\n anchorOffset: 0,\n focusKey: key,\n focusOffset: 0,\n isBackward: false,\n hasFocus: false\n });\n };\n\n return SelectionState;\n}(SelectionStateRecord);\n\nmodule.exports = SelectionState;"},{"id":18,"identifier":"external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","name":"external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","index":62,"index2":54,"size":42,"cacheable":false,"built":false,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"react-dom","loc":"25:15-35"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"react-dom","loc":"28:15-35"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"react-dom","loc":"36:15-35"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"react-dom","loc":"35:15-35"},{"moduleId":94,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorTextNode.react.js","module":"./lib/DraftEditorTextNode.react.js","moduleName":"./lib/DraftEditorTextNode.react.js","type":"cjs require","userRequest":"react-dom","loc":"22:15-35"},{"moduleId":146,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnSelect.js","module":"./lib/editOnSelect.js","moduleName":"./lib/editOnSelect.js","type":"cjs require","userRequest":"react-dom","loc":"17:15-35"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2},{"id":19,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockMapBuilder.js","name":"./lib/BlockMapBuilder.js","index":3,"index2":2,"size":654,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./BlockMapBuilder","loc":"21:22-50"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./BlockMapBuilder","loc":"16:22-50"},{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./BlockMapBuilder","loc":"19:22-50"},{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"./BlockMapBuilder","loc":"15:22-50"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./BlockMapBuilder","loc":"15:22-50"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar BlockMapBuilder = {\n createFromArray: function createFromArray(blocks) {\n return OrderedMap(blocks.map(function (block) {\n return [block.getKey(), block];\n }));\n }\n};\n\nmodule.exports = BlockMapBuilder;"},{"id":20,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/findRangesImmutable.js","name":"./lib/findRangesImmutable.js","index":7,"index2":4,"size":1052,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlock.js","issuerId":13,"issuerName":"./lib/ContentBlock.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":6,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlockNode.js","module":"./lib/ContentBlockNode.js","moduleName":"./lib/ContentBlockNode.js","type":"cjs require","userRequest":"./findRangesImmutable","loc":"30:26-58"},{"moduleId":13,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentBlock.js","module":"./lib/ContentBlock.js","moduleName":"./lib/ContentBlock.js","type":"cjs require","userRequest":"./findRangesImmutable","loc":"24:26-58"},{"moduleId":42,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeEntitiesAtEdges.js","module":"./lib/removeEntitiesAtEdges.js","moduleName":"./lib/removeEntitiesAtEdges.js","type":"cjs require","userRequest":"./findRangesImmutable","loc":"17:26-58"},{"moduleId":82,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockTree.js","module":"./lib/BlockTree.js","moduleName":"./lib/BlockTree.js","type":"cjs require","userRequest":"./findRangesImmutable","loc":"18:26-58"},{"moduleId":152,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/encodeInlineStyleRanges.js","module":"./lib/encodeInlineStyleRanges.js","moduleName":"./lib/encodeInlineStyleRanges.js","type":"cjs require","userRequest":"./findRangesImmutable","loc":"17:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\n/**\n * Search through an array to find contiguous stretches of elements that\n * match a specified filter function.\n *\n * When ranges are found, execute a specified `found` function to supply\n * the values to the caller.\n */\nfunction findRangesImmutable(haystack, areEqualFn, filterFn, foundFn) {\n if (!haystack.size) {\n return;\n }\n\n var cursor = 0;\n\n haystack.reduce(function (value, nextValue, nextIndex) {\n if (!areEqualFn(value, nextValue)) {\n if (filterFn(value)) {\n foundFn(cursor, nextIndex);\n }\n cursor = nextIndex;\n }\n return nextValue;\n });\n\n filterFn(haystack.last()) && foundFn(cursor, haystack.count());\n}\n\nmodule.exports = findRangesImmutable;"},{"id":21,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntity.js","name":"./lib/DraftEntity.js","index":33,"index2":30,"size":6710,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./DraftEntity","loc":"25:18-42"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./DraftEntity","loc":"26:18-42"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./DraftEntity","loc":"28:18-42"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DraftEntity","loc":"25:18-42"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./DraftEntity","loc":"22:18-42"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\nvar DraftEntityInstance = require('./DraftEntityInstance');\nvar Immutable = require('immutable');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar Map = Immutable.Map;\n\n\nvar instances = Map();\nvar instanceKey = 0;\n\n/**\n * Temporary utility for generating the warnings\n */\nfunction logWarning(oldMethodCall, newMethodCall) {\n console.warn('WARNING: ' + oldMethodCall + ' will be deprecated soon!\\nPlease use \"' + newMethodCall + '\" instead.');\n}\n\n/**\n * A \"document entity\" is an object containing metadata associated with a\n * piece of text in a ContentBlock.\n *\n * For example, a `link` entity might include a `uri` property. When a\n * ContentBlock is rendered in the browser, text that refers to that link\n * entity may be rendered as an anchor, with the `uri` as the href value.\n *\n * In a ContentBlock, every position in the text may correspond to zero\n * or one entities. This correspondence is tracked using a key string,\n * generated via DraftEntity.create() and used to obtain entity metadata\n * via DraftEntity.get().\n */\nvar DraftEntity = {\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.getLastCreatedEntityKey' instead.\n * ---\n * Get the random key string from whatever entity was last created.\n * We need this to support the new API, as part of transitioning to put Entity\n * storage in contentState.\n */\n getLastCreatedEntityKey: function getLastCreatedEntityKey() {\n logWarning('DraftEntity.getLastCreatedEntityKey', 'contentState.getLastCreatedEntityKey');\n return DraftEntity.__getLastCreatedEntityKey();\n },\n\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.createEntity' instead.\n * ---\n * Create a DraftEntityInstance and store it for later retrieval.\n *\n * A random key string will be generated and returned. This key may\n * be used to track the entity's usage in a ContentBlock, and for\n * retrieving data about the entity at render time.\n */\n create: function create(type, mutability, data) {\n logWarning('DraftEntity.create', 'contentState.createEntity');\n return DraftEntity.__create(type, mutability, data);\n },\n\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.addEntity' instead.\n * ---\n * Add an existing DraftEntityInstance to the DraftEntity map. This is\n * useful when restoring instances from the server.\n */\n add: function add(instance) {\n logWarning('DraftEntity.add', 'contentState.addEntity');\n return DraftEntity.__add(instance);\n },\n\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.getEntity' instead.\n * ---\n * Retrieve the entity corresponding to the supplied key string.\n */\n get: function get(key) {\n logWarning('DraftEntity.get', 'contentState.getEntity');\n return DraftEntity.__get(key);\n },\n\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.mergeEntityData' instead.\n * ---\n * Entity instances are immutable. If you need to update the data for an\n * instance, this method will merge your data updates and return a new\n * instance.\n */\n mergeData: function mergeData(key, toMerge) {\n logWarning('DraftEntity.mergeData', 'contentState.mergeEntityData');\n return DraftEntity.__mergeData(key, toMerge);\n },\n\n /**\n * WARNING: This method will be deprecated soon!\n * Please use 'contentState.replaceEntityData' instead.\n * ---\n * Completely replace the data for a given instance.\n */\n replaceData: function replaceData(key, newData) {\n logWarning('DraftEntity.replaceData', 'contentState.replaceEntityData');\n return DraftEntity.__replaceData(key, newData);\n },\n\n // ***********************************WARNING******************************\n // --- the above public API will be deprecated in the next version of Draft!\n // The methods below this line are private - don't call them directly.\n\n /**\n * Get the random key string from whatever entity was last created.\n * We need this to support the new API, as part of transitioning to put Entity\n * storage in contentState.\n */\n __getLastCreatedEntityKey: function __getLastCreatedEntityKey() {\n return '' + instanceKey;\n },\n\n /**\n * Create a DraftEntityInstance and store it for later retrieval.\n *\n * A random key string will be generated and returned. This key may\n * be used to track the entity's usage in a ContentBlock, and for\n * retrieving data about the entity at render time.\n */\n __create: function __create(type, mutability, data) {\n return DraftEntity.__add(new DraftEntityInstance({ type: type, mutability: mutability, data: data || {} }));\n },\n\n /**\n * Add an existing DraftEntityInstance to the DraftEntity map. This is\n * useful when restoring instances from the server.\n */\n __add: function __add(instance) {\n var key = '' + ++instanceKey;\n instances = instances.set(key, instance);\n return key;\n },\n\n /**\n * Retrieve the entity corresponding to the supplied key string.\n */\n __get: function __get(key) {\n var instance = instances.get(key);\n !!!instance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown DraftEntity key: %s.', key) : invariant(false) : void 0;\n return instance;\n },\n\n /**\n * Entity instances are immutable. If you need to update the data for an\n * instance, this method will merge your data updates and return a new\n * instance.\n */\n __mergeData: function __mergeData(key, toMerge) {\n var instance = DraftEntity.__get(key);\n var newData = _extends({}, instance.getData(), toMerge);\n var newInstance = instance.set('data', newData);\n instances = instances.set(key, newInstance);\n return newInstance;\n },\n\n /**\n * Completely replace the data for a given instance.\n */\n __replaceData: function __replaceData(key, newData) {\n var instance = DraftEntity.__get(key);\n var newInstance = instance.set('data', newData);\n instances = instances.set(key, newInstance);\n return newInstance;\n }\n};\n\nmodule.exports = DraftEntity;"},{"id":22,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/isEventHandled.js","name":"./lib/isEventHandled.js","index":52,"index2":49,"size":597,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","issuerId":88,"issuerName":"./lib/DraftEditorCompositionHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./isEventHandled","loc":"21:21-48"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./isEventHandled","loc":"22:21-48"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"./isEventHandled","loc":"20:21-48"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"./isEventHandled","loc":"22:21-48"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./isEventHandled","loc":"25:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\n/**\n * Utility method for determining whether or not the value returned\n * from a handler indicates that it was handled.\n */\nfunction isEventHandled(value) {\n return value === 'handled' || value === true;\n}\n\nmodule.exports = isEventHandled;"},{"id":23,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeTextWithStrategy.js","name":"./lib/removeTextWithStrategy.js","index":122,"index2":117,"size":1210,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","issuerId":130,"issuerName":"./lib/keyCommandBackspaceToStartOfLine.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":130,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","module":"./lib/keyCommandBackspaceToStartOfLine.js","moduleName":"./lib/keyCommandBackspaceToStartOfLine.js","type":"cjs require","userRequest":"./removeTextWithStrategy","loc":"20:29-64"},{"moduleId":132,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceWord.js","module":"./lib/keyCommandBackspaceWord.js","moduleName":"./lib/keyCommandBackspaceWord.js","type":"cjs require","userRequest":"./removeTextWithStrategy","loc":"19:29-64"},{"moduleId":134,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandDeleteWord.js","module":"./lib/keyCommandDeleteWord.js","moduleName":"./lib/keyCommandDeleteWord.js","type":"cjs require","userRequest":"./removeTextWithStrategy","loc":"19:29-64"},{"moduleId":138,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainBackspace.js","module":"./lib/keyCommandPlainBackspace.js","moduleName":"./lib/keyCommandPlainBackspace.js","type":"cjs require","userRequest":"./removeTextWithStrategy","loc":"19:29-64"},{"moduleId":139,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainDelete.js","module":"./lib/keyCommandPlainDelete.js","moduleName":"./lib/keyCommandPlainDelete.js","type":"cjs require","userRequest":"./removeTextWithStrategy","loc":"19:29-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\n\n/**\n * For a collapsed selection state, remove text based on the specified strategy.\n * If the selection state is not collapsed, remove the entire selected range.\n */\nfunction removeTextWithStrategy(editorState, strategy, direction) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var target = selection;\n if (selection.isCollapsed()) {\n if (direction === 'forward') {\n if (editorState.isSelectionAtEndOfContent()) {\n return content;\n }\n } else if (editorState.isSelectionAtStartOfContent()) {\n return content;\n }\n\n target = strategy(editorState);\n if (target === selection) {\n return content;\n }\n }\n return DraftModifier.removeRange(content, target, direction);\n}\n\nmodule.exports = removeTextWithStrategy;"},{"id":24,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getContentStateFragment.js","name":"./lib/getContentStateFragment.js","index":17,"index2":17,"size":2028,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./getContentStateFragment","loc":"21:30-66"},{"moduleId":58,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getFragmentFromSelection.js","module":"./lib/getFragmentFromSelection.js","moduleName":"./lib/getFragmentFromSelection.js","type":"cjs require","userRequest":"./getContentStateFragment","loc":"15:30-66"},{"moduleId":129,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/SecondaryClipboard.js","module":"./lib/SecondaryClipboard.js","moduleName":"./lib/SecondaryClipboard.js","type":"cjs require","userRequest":"./getContentStateFragment","loc":"18:30-66"},{"moduleId":140,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandTransposeCharacters.js","module":"./lib/keyCommandTransposeCharacters.js","moduleName":"./lib/keyCommandTransposeCharacters.js","type":"cjs require","userRequest":"./getContentStateFragment","loc":"18:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar randomizeBlockMapKeys = require('./randomizeBlockMapKeys');\nvar removeEntitiesAtEdges = require('./removeEntitiesAtEdges');\n\nvar getContentStateFragment = function getContentStateFragment(contentState, selectionState) {\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n\n // Edge entities should be stripped to ensure that we don't preserve\n // invalid partial entities when the fragment is reused. We do, however,\n // preserve entities that are entirely within the selection range.\n var contentWithoutEdgeEntities = removeEntitiesAtEdges(contentState, selectionState);\n\n var blockMap = contentWithoutEdgeEntities.getBlockMap();\n var blockKeys = blockMap.keySeq();\n var startIndex = blockKeys.indexOf(startKey);\n var endIndex = blockKeys.indexOf(endKey) + 1;\n\n return randomizeBlockMapKeys(blockMap.slice(startIndex, endIndex).map(function (block, blockKey) {\n var text = block.getText();\n var chars = block.getCharacterList();\n\n if (startKey === endKey) {\n return block.merge({\n text: text.slice(startOffset, endOffset),\n characterList: chars.slice(startOffset, endOffset)\n });\n }\n\n if (blockKey === startKey) {\n return block.merge({\n text: text.slice(startOffset),\n characterList: chars.slice(startOffset)\n });\n }\n\n if (blockKey === endKey) {\n return block.merge({\n text: text.slice(0, endOffset),\n characterList: chars.slice(0, endOffset)\n });\n }\n\n return block;\n }));\n};\n\nmodule.exports = getContentStateFragment;"},{"id":25,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiDirection.js","name":"./node_modules/fbjs/lib/UnicodeBidiDirection.js","index":40,"index2":34,"size":2850,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":32,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidi.js","module":"./node_modules/fbjs/lib/UnicodeBidi.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidi.js","type":"cjs require","userRequest":"./UnicodeBidiDirection","loc":"21:27-60"},{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeBidiDirection","loc":"32:27-67"},{"moduleId":84,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiService.js","module":"./node_modules/fbjs/lib/UnicodeBidiService.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidiService.js","type":"cjs require","userRequest":"./UnicodeBidiDirection","loc":"46:27-60"},{"moduleId":93,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","module":"./lib/DraftEditorDecoratedLeaves.react.js","moduleName":"./lib/DraftEditorDecoratedLeaves.react.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeBidiDirection","loc":"31:27-67"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n * \n */\n\n/**\n * Constants to represent text directionality\n *\n * Also defines a *global* direciton, to be used in bidi algorithms as a\n * default fallback direciton, when no better direction is found or provided.\n *\n * NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial\n * global direction value based on the application.\n *\n * Part of the implementation of Unicode Bidirectional Algorithm (UBA)\n * Unicode Standard Annex #9 (UAX9)\n * http://www.unicode.org/reports/tr9/\n */\n\n'use strict';\n\nvar invariant = require('./invariant');\n\nvar NEUTRAL = 'NEUTRAL'; // No strong direction\nvar LTR = 'LTR'; // Left-to-Right direction\nvar RTL = 'RTL'; // Right-to-Left direction\n\nvar globalDir = null;\n\n// == Helpers ==\n\n/**\n * Check if a directionality value is a Strong one\n */\nfunction isStrong(dir) {\n return dir === LTR || dir === RTL;\n}\n\n/**\n * Get string value to be used for `dir` HTML attribute or `direction` CSS\n * property.\n */\nfunction getHTMLDir(dir) {\n !isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;\n return dir === LTR ? 'ltr' : 'rtl';\n}\n\n/**\n * Get string value to be used for `dir` HTML attribute or `direction` CSS\n * property, but returns null if `dir` has same value as `otherDir`.\n * `null`.\n */\nfunction getHTMLDirIfDifferent(dir, otherDir) {\n !isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;\n !isStrong(otherDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`otherDir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;\n return dir === otherDir ? null : getHTMLDir(dir);\n}\n\n// == Global Direction ==\n\n/**\n * Set the global direction.\n */\nfunction setGlobalDir(dir) {\n globalDir = dir;\n}\n\n/**\n * Initialize the global direction\n */\nfunction initGlobalDir() {\n setGlobalDir(LTR);\n}\n\n/**\n * Get the global direction\n */\nfunction getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}\n\nvar UnicodeBidiDirection = {\n // Values\n NEUTRAL: NEUTRAL,\n LTR: LTR,\n RTL: RTL,\n // Helpers\n isStrong: isStrong,\n getHTMLDir: getHTMLDir,\n getHTMLDirIfDifferent: getHTMLDirIfDifferent,\n // Global Direction\n setGlobalDir: setGlobalDir,\n initGlobalDir: initGlobalDir,\n getGlobalDir: getGlobalDir\n};\n\nmodule.exports = UnicodeBidiDirection;"},{"id":26,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftBlockRenderMap.js","name":"./lib/DefaultDraftBlockRenderMap.js","index":44,"index2":45,"size":1456,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./DefaultDraftBlockRenderMap","loc":"25:33-72"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./DefaultDraftBlockRenderMap","loc":"27:33-72"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DefaultDraftBlockRenderMap","loc":"21:33-72"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DefaultDraftBlockRenderMap","loc":"26:33-72"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar _require = require('immutable'),\n Map = _require.Map;\n\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\n\nvar UL_WRAP = React.createElement('ul', { className: cx('public/DraftStyleDefault/ul') });\nvar OL_WRAP = React.createElement('ol', { className: cx('public/DraftStyleDefault/ol') });\nvar PRE_WRAP = React.createElement('pre', { className: cx('public/DraftStyleDefault/pre') });\n\nvar DefaultDraftBlockRenderMap = Map({\n 'header-one': {\n element: 'h1'\n },\n 'header-two': {\n element: 'h2'\n },\n 'header-three': {\n element: 'h3'\n },\n 'header-four': {\n element: 'h4'\n },\n 'header-five': {\n element: 'h5'\n },\n 'header-six': {\n element: 'h6'\n },\n 'unordered-list-item': {\n element: 'li',\n wrapper: UL_WRAP\n },\n 'ordered-list-item': {\n element: 'li',\n wrapper: OL_WRAP\n },\n blockquote: {\n element: 'blockquote'\n },\n atomic: {\n element: 'figure'\n },\n 'code-block': {\n element: 'pre',\n wrapper: PRE_WRAP\n },\n unstyled: {\n element: 'div',\n aliasedElements: ['p']\n }\n});\n\nmodule.exports = DefaultDraftBlockRenderMap;"},{"id":27,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/Style.js","name":"./node_modules/fbjs/lib/Style.js","index":78,"index2":76,"size":1750,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/Style","loc":"30:12-37"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/Style","loc":"38:12-37"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/Style","loc":"37:12-37"},{"moduleId":123,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCut.js","module":"./lib/editOnCut.js","moduleName":"./lib/editOnCut.js","type":"cjs require","userRequest":"fbjs/lib/Style","loc":"17:12-37"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar getStyleProperty = require('./getStyleProperty');\n\n/**\n * @param {DOMNode} element [description]\n * @param {string} name Overflow style property name.\n * @return {boolean} True if the supplied ndoe is scrollable.\n */\nfunction _isNodeScrollable(element, name) {\n var overflow = Style.get(element, name);\n return overflow === 'auto' || overflow === 'scroll';\n}\n\n/**\n * Utilities for querying and mutating style properties.\n */\nvar Style = {\n /**\n * Gets the style property for the supplied node. This will return either the\n * computed style, if available, or the declared style.\n *\n * @param {DOMNode} node\n * @param {string} name Style property name.\n * @return {?string} Style property value.\n */\n get: getStyleProperty,\n\n /**\n * Determines the nearest ancestor of a node that is scrollable.\n *\n * NOTE: This can be expensive if used repeatedly or on a node nested deeply.\n *\n * @param {?DOMNode} node Node from which to start searching.\n * @return {?DOMWindow|DOMElement} Scroll parent of the supplied node.\n */\n getScrollParent: function getScrollParent(node) {\n if (!node) {\n return null;\n }\n var ownerDocument = node.ownerDocument;\n while (node && node !== ownerDocument.body) {\n if (_isNodeScrollable(node, 'overflow') || _isNodeScrollable(node, 'overflowY') || _isNodeScrollable(node, 'overflowX')) {\n return node;\n }\n node = node.parentNode;\n }\n return ownerDocument.defaultView || ownerDocument.parentWindow;\n }\n\n};\n\nmodule.exports = Style;"},{"id":28,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getScrollPosition.js","name":"./node_modules/fbjs/lib/getScrollPosition.js","index":84,"index2":81,"size":1605,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/getScrollPosition","loc":"36:24-61"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/getScrollPosition","loc":"45:24-61"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/getScrollPosition","loc":"40:24-61"},{"moduleId":123,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCut.js","module":"./lib/editOnCut.js","moduleName":"./lib/editOnCut.js","type":"cjs require","userRequest":"fbjs/lib/getScrollPosition","loc":"20:24-61"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar getDocumentScrollElement = require('./getDocumentScrollElement');\nvar getUnboundedScrollPosition = require('./getUnboundedScrollPosition');\n\n/**\n * Gets the scroll position of the supplied element or window.\n *\n * The return values are bounded. This means that if the scroll position is\n * negative or exceeds the element boundaries (which is possible using inertial\n * scrolling), you will get zero or the maximum scroll position, respectively.\n *\n * If you need the unbound scroll position, use `getUnboundedScrollPosition`.\n *\n * @param {DOMWindow|DOMElement} scrollable\n * @return {object} Map with `x` and `y` keys.\n */\nfunction getScrollPosition(scrollable) {\n var documentScrollElement = getDocumentScrollElement(scrollable.ownerDocument || scrollable.document);\n if (scrollable.Window && scrollable instanceof scrollable.Window) {\n scrollable = documentScrollElement;\n }\n var scrollPosition = getUnboundedScrollPosition(scrollable);\n\n var viewport = scrollable === documentScrollElement ? scrollable.ownerDocument.documentElement : scrollable;\n\n var xMax = scrollable.scrollWidth - viewport.clientWidth;\n var yMax = scrollable.scrollHeight - viewport.clientHeight;\n\n scrollPosition.x = Math.max(0, Math.min(scrollPosition.x, xMax));\n scrollPosition.y = Math.max(0, Math.min(scrollPosition.y, yMax));\n\n return scrollPosition;\n}\n\nmodule.exports = getScrollPosition;"},{"id":29,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/emptyFunction.js","name":"./node_modules/fbjs/lib/emptyFunction.js","index":31,"index2":27,"size":959,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":54,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","module":"./node_modules/fbjs/lib/DataTransfer.js","moduleName":"./node_modules/fbjs/lib/DataTransfer.js","type":"cjs require","userRequest":"./emptyFunction","loc":"17:20-46"},{"moduleId":82,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockTree.js","module":"./lib/BlockTree.js","moduleName":"./lib/BlockTree.js","type":"cjs require","userRequest":"fbjs/lib/emptyFunction","loc":"17:20-53"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/emptyFunction","loc":"42:20-53"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;"},{"id":30,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","name":"./lib/ContentState.js","index":32,"index2":33,"size":7047,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"./ContentState","loc":"22:19-44"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./ContentState","loc":"20:19-44"},{"moduleId":153,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromRawToDraftState.js","module":"./lib/convertFromRawToDraftState.js","moduleName":"./lib/convertFromRawToDraftState.js","type":"cjs require","userRequest":"./ContentState","loc":"21:19-44"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftEntity = require('./DraftEntity');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar gkx = require('./gkx');\nvar sanitizeDraftText = require('./sanitizeDraftText');\n\nvar List = Immutable.List,\n Record = Immutable.Record,\n Repeat = Immutable.Repeat;\n\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\n\nvar defaultRecord = {\n entityMap: null,\n blockMap: null,\n selectionBefore: null,\n selectionAfter: null\n};\n\nvar ContentBlockNodeRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\nvar ContentStateRecord = Record(defaultRecord);\n\nvar ContentState = function (_ContentStateRecord) {\n _inherits(ContentState, _ContentStateRecord);\n\n function ContentState() {\n _classCallCheck(this, ContentState);\n\n return _possibleConstructorReturn(this, _ContentStateRecord.apply(this, arguments));\n }\n\n ContentState.prototype.getEntityMap = function getEntityMap() {\n // TODO: update this when we fully remove DraftEntity\n return DraftEntity;\n };\n\n ContentState.prototype.getBlockMap = function getBlockMap() {\n return this.get('blockMap');\n };\n\n ContentState.prototype.getSelectionBefore = function getSelectionBefore() {\n return this.get('selectionBefore');\n };\n\n ContentState.prototype.getSelectionAfter = function getSelectionAfter() {\n return this.get('selectionAfter');\n };\n\n ContentState.prototype.getBlockForKey = function getBlockForKey(key) {\n var block = this.getBlockMap().get(key);\n return block;\n };\n\n ContentState.prototype.getKeyBefore = function getKeyBefore(key) {\n return this.getBlockMap().reverse().keySeq().skipUntil(function (v) {\n return v === key;\n }).skip(1).first();\n };\n\n ContentState.prototype.getKeyAfter = function getKeyAfter(key) {\n return this.getBlockMap().keySeq().skipUntil(function (v) {\n return v === key;\n }).skip(1).first();\n };\n\n ContentState.prototype.getBlockAfter = function getBlockAfter(key) {\n return this.getBlockMap().skipUntil(function (_, k) {\n return k === key;\n }).skip(1).first();\n };\n\n ContentState.prototype.getBlockBefore = function getBlockBefore(key) {\n return this.getBlockMap().reverse().skipUntil(function (_, k) {\n return k === key;\n }).skip(1).first();\n };\n\n ContentState.prototype.getBlocksAsArray = function getBlocksAsArray() {\n return this.getBlockMap().toArray();\n };\n\n ContentState.prototype.getFirstBlock = function getFirstBlock() {\n return this.getBlockMap().first();\n };\n\n ContentState.prototype.getLastBlock = function getLastBlock() {\n return this.getBlockMap().last();\n };\n\n ContentState.prototype.getPlainText = function getPlainText(delimiter) {\n return this.getBlockMap().map(function (block) {\n return block ? block.getText() : '';\n }).join(delimiter || '\\n');\n };\n\n ContentState.prototype.getLastCreatedEntityKey = function getLastCreatedEntityKey() {\n // TODO: update this when we fully remove DraftEntity\n return DraftEntity.__getLastCreatedEntityKey();\n };\n\n ContentState.prototype.hasText = function hasText() {\n var blockMap = this.getBlockMap();\n return blockMap.size > 1 || blockMap.first().getLength() > 0;\n };\n\n ContentState.prototype.createEntity = function createEntity(type, mutability, data) {\n // TODO: update this when we fully remove DraftEntity\n DraftEntity.__create(type, mutability, data);\n return this;\n };\n\n ContentState.prototype.mergeEntityData = function mergeEntityData(key, toMerge) {\n // TODO: update this when we fully remove DraftEntity\n DraftEntity.__mergeData(key, toMerge);\n return this;\n };\n\n ContentState.prototype.replaceEntityData = function replaceEntityData(key, newData) {\n // TODO: update this when we fully remove DraftEntity\n DraftEntity.__replaceData(key, newData);\n return this;\n };\n\n ContentState.prototype.addEntity = function addEntity(instance) {\n // TODO: update this when we fully remove DraftEntity\n DraftEntity.__add(instance);\n return this;\n };\n\n ContentState.prototype.getEntity = function getEntity(key) {\n // TODO: update this when we fully remove DraftEntity\n return DraftEntity.__get(key);\n };\n\n ContentState.createFromBlockArray = function createFromBlockArray(\n // TODO: update flow type when we completely deprecate the old entity API\n blocks, entityMap) {\n // TODO: remove this when we completely deprecate the old entity API\n var theBlocks = Array.isArray(blocks) ? blocks : blocks.contentBlocks;\n var blockMap = BlockMapBuilder.createFromArray(theBlocks);\n var selectionState = blockMap.isEmpty() ? new SelectionState() : SelectionState.createEmpty(blockMap.first().getKey());\n return new ContentState({\n blockMap: blockMap,\n entityMap: entityMap || DraftEntity,\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n };\n\n ContentState.createFromText = function createFromText(text) {\n var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /\\r\\n?|\\n/g;\n\n var strings = text.split(delimiter);\n var blocks = strings.map(function (block) {\n block = sanitizeDraftText(block);\n return new ContentBlockNodeRecord({\n key: generateRandomKey(),\n text: block,\n type: 'unstyled',\n characterList: List(Repeat(CharacterMetadata.EMPTY, block.length))\n });\n });\n return ContentState.createFromBlockArray(blocks);\n };\n\n return ContentState;\n}(ContentStateRecord);\n\nmodule.exports = ContentState;"},{"id":31,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/sanitizeDraftText.js","name":"./lib/sanitizeDraftText.js","index":36,"index2":32,"size":527,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","issuerId":30,"issuerName":"./lib/ContentState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":30,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentState.js","module":"./lib/ContentState.js","moduleName":"./lib/ContentState.js","type":"cjs require","userRequest":"./sanitizeDraftText","loc":"31:24-54"},{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./sanitizeDraftText","loc":"39:24-54"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./sanitizeDraftText","loc":"29:24-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict\n */\n\n'use strict';\n\nvar REGEX_BLOCK_DELIMITER = new RegExp('\\r', 'g');\n\nfunction sanitizeDraftText(input) {\n return input.replace(REGEX_BLOCK_DELIMITER, '');\n}\n\nmodule.exports = sanitizeDraftText;"},{"id":32,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidi.js","name":"./node_modules/fbjs/lib/UnicodeBidi.js","index":39,"index2":35,"size":13739,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeBidi","loc":"31:18-49"},{"moduleId":84,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiService.js","module":"./node_modules/fbjs/lib/UnicodeBidiService.js","moduleName":"./node_modules/fbjs/lib/UnicodeBidiService.js","type":"cjs require","userRequest":"./UnicodeBidi","loc":"45:18-42"},{"moduleId":93,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","module":"./lib/DraftEditorDecoratedLeaves.react.js","moduleName":"./lib/DraftEditorDecoratedLeaves.react.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeBidi","loc":"30:18-49"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n * \n */\n\n/**\n * Basic (stateless) API for text direction detection\n *\n * Part of our implementation of Unicode Bidirectional Algorithm (UBA)\n * Unicode Standard Annex #9 (UAX9)\n * http://www.unicode.org/reports/tr9/\n */\n\n'use strict';\n\nvar UnicodeBidiDirection = require('./UnicodeBidiDirection');\n\nvar invariant = require('./invariant');\n\n/**\n * RegExp ranges of characters with a *Strong* Bidi_Class value.\n *\n * Data is based on DerivedBidiClass.txt in UCD version 7.0.0.\n *\n * NOTE: For performance reasons, we only support Unicode's\n * Basic Multilingual Plane (BMP) for now.\n */\nvar RANGE_BY_BIDI_TYPE = {\n\n L: 'A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u01BA\\u01BB' + '\\u01BC-\\u01BF\\u01C0-\\u01C3\\u01C4-\\u0293\\u0294\\u0295-\\u02AF\\u02B0-\\u02B8' + '\\u02BB-\\u02C1\\u02D0-\\u02D1\\u02E0-\\u02E4\\u02EE\\u0370-\\u0373\\u0376-\\u0377' + '\\u037A\\u037B-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1' + '\\u03A3-\\u03F5\\u03F7-\\u0481\\u0482\\u048A-\\u052F\\u0531-\\u0556\\u0559' + '\\u055A-\\u055F\\u0561-\\u0587\\u0589\\u0903\\u0904-\\u0939\\u093B\\u093D' + '\\u093E-\\u0940\\u0949-\\u094C\\u094E-\\u094F\\u0950\\u0958-\\u0961\\u0964-\\u0965' + '\\u0966-\\u096F\\u0970\\u0971\\u0972-\\u0980\\u0982-\\u0983\\u0985-\\u098C' + '\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD' + '\\u09BE-\\u09C0\\u09C7-\\u09C8\\u09CB-\\u09CC\\u09CE\\u09D7\\u09DC-\\u09DD' + '\\u09DF-\\u09E1\\u09E6-\\u09EF\\u09F0-\\u09F1\\u09F4-\\u09F9\\u09FA\\u0A03' + '\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33' + '\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A3E-\\u0A40\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A6F' + '\\u0A72-\\u0A74\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0' + '\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0ABE-\\u0AC0\\u0AC9\\u0ACB-\\u0ACC\\u0AD0' + '\\u0AE0-\\u0AE1\\u0AE6-\\u0AEF\\u0AF0\\u0B02-\\u0B03\\u0B05-\\u0B0C\\u0B0F-\\u0B10' + '\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B3E\\u0B40' + '\\u0B47-\\u0B48\\u0B4B-\\u0B4C\\u0B57\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B66-\\u0B6F' + '\\u0B70\\u0B71\\u0B72-\\u0B77\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95' + '\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9' + '\\u0BBE-\\u0BBF\\u0BC1-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD0\\u0BD7' + '\\u0BE6-\\u0BEF\\u0BF0-\\u0BF2\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10' + '\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C41-\\u0C44\\u0C58-\\u0C59\\u0C60-\\u0C61' + '\\u0C66-\\u0C6F\\u0C7F\\u0C82-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8' + '\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CBE\\u0CBF\\u0CC0-\\u0CC4\\u0CC6' + '\\u0CC7-\\u0CC8\\u0CCA-\\u0CCB\\u0CD5-\\u0CD6\\u0CDE\\u0CE0-\\u0CE1\\u0CE6-\\u0CEF' + '\\u0CF1-\\u0CF2\\u0D02-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D' + '\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D4E\\u0D57\\u0D60-\\u0D61' + '\\u0D66-\\u0D6F\\u0D70-\\u0D75\\u0D79\\u0D7A-\\u0D7F\\u0D82-\\u0D83\\u0D85-\\u0D96' + '\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF' + '\\u0DE6-\\u0DEF\\u0DF2-\\u0DF3\\u0DF4\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E45' + '\\u0E46\\u0E4F\\u0E50-\\u0E59\\u0E5A-\\u0E5B\\u0E81-\\u0E82\\u0E84\\u0E87-\\u0E88' + '\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7' + '\\u0EAA-\\u0EAB\\u0EAD-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6' + '\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F01-\\u0F03\\u0F04-\\u0F12\\u0F13\\u0F14' + '\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F20-\\u0F29\\u0F2A-\\u0F33\\u0F34\\u0F36\\u0F38' + '\\u0F3E-\\u0F3F\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F7F\\u0F85\\u0F88-\\u0F8C' + '\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD0-\\u0FD4\\u0FD5-\\u0FD8' + '\\u0FD9-\\u0FDA\\u1000-\\u102A\\u102B-\\u102C\\u1031\\u1038\\u103B-\\u103C\\u103F' + '\\u1040-\\u1049\\u104A-\\u104F\\u1050-\\u1055\\u1056-\\u1057\\u105A-\\u105D\\u1061' + '\\u1062-\\u1064\\u1065-\\u1066\\u1067-\\u106D\\u106E-\\u1070\\u1075-\\u1081' + '\\u1083-\\u1084\\u1087-\\u108C\\u108E\\u108F\\u1090-\\u1099\\u109A-\\u109C' + '\\u109E-\\u109F\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FB\\u10FC' + '\\u10FD-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288' + '\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5' + '\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1360-\\u1368' + '\\u1369-\\u137C\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166D-\\u166E' + '\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EB-\\u16ED\\u16EE-\\u16F0' + '\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1735-\\u1736' + '\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17B6\\u17BE-\\u17C5' + '\\u17C7-\\u17C8\\u17D4-\\u17D6\\u17D7\\u17D8-\\u17DA\\u17DC\\u17E0-\\u17E9' + '\\u1810-\\u1819\\u1820-\\u1842\\u1843\\u1844-\\u1877\\u1880-\\u18A8\\u18AA' + '\\u18B0-\\u18F5\\u1900-\\u191E\\u1923-\\u1926\\u1929-\\u192B\\u1930-\\u1931' + '\\u1933-\\u1938\\u1946-\\u194F\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB' + '\\u19B0-\\u19C0\\u19C1-\\u19C7\\u19C8-\\u19C9\\u19D0-\\u19D9\\u19DA\\u1A00-\\u1A16' + '\\u1A19-\\u1A1A\\u1A1E-\\u1A1F\\u1A20-\\u1A54\\u1A55\\u1A57\\u1A61\\u1A63-\\u1A64' + '\\u1A6D-\\u1A72\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1AA0-\\u1AA6\\u1AA7\\u1AA8-\\u1AAD' + '\\u1B04\\u1B05-\\u1B33\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43-\\u1B44\\u1B45-\\u1B4B' + '\\u1B50-\\u1B59\\u1B5A-\\u1B60\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1B82\\u1B83-\\u1BA0' + '\\u1BA1\\u1BA6-\\u1BA7\\u1BAA\\u1BAE-\\u1BAF\\u1BB0-\\u1BB9\\u1BBA-\\u1BE5\\u1BE7' + '\\u1BEA-\\u1BEC\\u1BEE\\u1BF2-\\u1BF3\\u1BFC-\\u1BFF\\u1C00-\\u1C23\\u1C24-\\u1C2B' + '\\u1C34-\\u1C35\\u1C3B-\\u1C3F\\u1C40-\\u1C49\\u1C4D-\\u1C4F\\u1C50-\\u1C59' + '\\u1C5A-\\u1C77\\u1C78-\\u1C7D\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u1CE1' + '\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF2-\\u1CF3\\u1CF5-\\u1CF6\\u1D00-\\u1D2B' + '\\u1D2C-\\u1D6A\\u1D6B-\\u1D77\\u1D78\\u1D79-\\u1D9A\\u1D9B-\\u1DBF\\u1E00-\\u1F15' + '\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D' + '\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC' + '\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200E' + '\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D' + '\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2134\\u2135-\\u2138\\u2139' + '\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u214F\\u2160-\\u2182\\u2183-\\u2184' + '\\u2185-\\u2188\\u2336-\\u237A\\u2395\\u249C-\\u24E9\\u26AC\\u2800-\\u28FF' + '\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C7B\\u2C7C-\\u2C7D\\u2C7E-\\u2CE4' + '\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F' + '\\u2D70\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE' + '\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005\\u3006\\u3007' + '\\u3021-\\u3029\\u302E-\\u302F\\u3031-\\u3035\\u3038-\\u303A\\u303B\\u303C' + '\\u3041-\\u3096\\u309D-\\u309E\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FE\\u30FF' + '\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u3191\\u3192-\\u3195\\u3196-\\u319F' + '\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3200-\\u321C\\u3220-\\u3229\\u322A-\\u3247' + '\\u3248-\\u324F\\u3260-\\u327B\\u327F\\u3280-\\u3289\\u328A-\\u32B0\\u32C0-\\u32CB' + '\\u32D0-\\u32FE\\u3300-\\u3376\\u337B-\\u33DD\\u33E0-\\u33FE\\u3400-\\u4DB5' + '\\u4E00-\\u9FCC\\uA000-\\uA014\\uA015\\uA016-\\uA48C\\uA4D0-\\uA4F7\\uA4F8-\\uA4FD' + '\\uA4FE-\\uA4FF\\uA500-\\uA60B\\uA60C\\uA610-\\uA61F\\uA620-\\uA629\\uA62A-\\uA62B' + '\\uA640-\\uA66D\\uA66E\\uA680-\\uA69B\\uA69C-\\uA69D\\uA6A0-\\uA6E5\\uA6E6-\\uA6EF' + '\\uA6F2-\\uA6F7\\uA722-\\uA76F\\uA770\\uA771-\\uA787\\uA789-\\uA78A\\uA78B-\\uA78E' + '\\uA790-\\uA7AD\\uA7B0-\\uA7B1\\uA7F7\\uA7F8-\\uA7F9\\uA7FA\\uA7FB-\\uA801' + '\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA823-\\uA824\\uA827\\uA830-\\uA835' + '\\uA836-\\uA837\\uA840-\\uA873\\uA880-\\uA881\\uA882-\\uA8B3\\uA8B4-\\uA8C3' + '\\uA8CE-\\uA8CF\\uA8D0-\\uA8D9\\uA8F2-\\uA8F7\\uA8F8-\\uA8FA\\uA8FB\\uA900-\\uA909' + '\\uA90A-\\uA925\\uA92E-\\uA92F\\uA930-\\uA946\\uA952-\\uA953\\uA95F\\uA960-\\uA97C' + '\\uA983\\uA984-\\uA9B2\\uA9B4-\\uA9B5\\uA9BA-\\uA9BB\\uA9BD-\\uA9C0\\uA9C1-\\uA9CD' + '\\uA9CF\\uA9D0-\\uA9D9\\uA9DE-\\uA9DF\\uA9E0-\\uA9E4\\uA9E6\\uA9E7-\\uA9EF' + '\\uA9F0-\\uA9F9\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA2F-\\uAA30\\uAA33-\\uAA34' + '\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA4D\\uAA50-\\uAA59\\uAA5C-\\uAA5F\\uAA60-\\uAA6F' + '\\uAA70\\uAA71-\\uAA76\\uAA77-\\uAA79\\uAA7A\\uAA7B\\uAA7D\\uAA7E-\\uAAAF\\uAAB1' + '\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADC\\uAADD\\uAADE-\\uAADF' + '\\uAAE0-\\uAAEA\\uAAEB\\uAAEE-\\uAAEF\\uAAF0-\\uAAF1\\uAAF2\\uAAF3-\\uAAF4\\uAAF5' + '\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E' + '\\uAB30-\\uAB5A\\uAB5B\\uAB5C-\\uAB5F\\uAB64-\\uAB65\\uABC0-\\uABE2\\uABE3-\\uABE4' + '\\uABE6-\\uABE7\\uABE9-\\uABEA\\uABEB\\uABEC\\uABF0-\\uABF9\\uAC00-\\uD7A3' + '\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uE000-\\uF8FF\\uF900-\\uFA6D\\uFA70-\\uFAD9' + '\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFF6F\\uFF70' + '\\uFF71-\\uFF9D\\uFF9E-\\uFF9F\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF' + '\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC',\n\n R: '\\u0590\\u05BE\\u05C0\\u05C3\\u05C6\\u05C8-\\u05CF\\u05D0-\\u05EA\\u05EB-\\u05EF' + '\\u05F0-\\u05F2\\u05F3-\\u05F4\\u05F5-\\u05FF\\u07C0-\\u07C9\\u07CA-\\u07EA' + '\\u07F4-\\u07F5\\u07FA\\u07FB-\\u07FF\\u0800-\\u0815\\u081A\\u0824\\u0828' + '\\u082E-\\u082F\\u0830-\\u083E\\u083F\\u0840-\\u0858\\u085C-\\u085D\\u085E' + '\\u085F-\\u089F\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB37\\uFB38-\\uFB3C' + '\\uFB3D\\uFB3E\\uFB3F\\uFB40-\\uFB41\\uFB42\\uFB43-\\uFB44\\uFB45\\uFB46-\\uFB4F',\n\n AL: '\\u0608\\u060B\\u060D\\u061B\\u061C\\u061D\\u061E-\\u061F\\u0620-\\u063F\\u0640' + '\\u0641-\\u064A\\u066D\\u066E-\\u066F\\u0671-\\u06D3\\u06D4\\u06D5\\u06E5-\\u06E6' + '\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FD-\\u06FE\\u06FF\\u0700-\\u070D\\u070E\\u070F' + '\\u0710\\u0712-\\u072F\\u074B-\\u074C\\u074D-\\u07A5\\u07B1\\u07B2-\\u07BF' + '\\u08A0-\\u08B2\\u08B3-\\u08E3\\uFB50-\\uFBB1\\uFBB2-\\uFBC1\\uFBC2-\\uFBD2' + '\\uFBD3-\\uFD3D\\uFD40-\\uFD4F\\uFD50-\\uFD8F\\uFD90-\\uFD91\\uFD92-\\uFDC7' + '\\uFDC8-\\uFDCF\\uFDF0-\\uFDFB\\uFDFC\\uFDFE-\\uFDFF\\uFE70-\\uFE74\\uFE75' + '\\uFE76-\\uFEFC\\uFEFD-\\uFEFE'\n\n};\n\nvar REGEX_STRONG = new RegExp('[' + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');\n\nvar REGEX_RTL = new RegExp('[' + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');\n\n/**\n * Returns the first strong character (has Bidi_Class value of L, R, or AL).\n *\n * @param str A text block; e.g. paragraph, table cell, tag\n * @return A character with strong bidi direction, or null if not found\n */\nfunction firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}\n\n/**\n * Returns the direction of a block of text, based on the direction of its\n * first strong character (has Bidi_Class value of L, R, or AL).\n *\n * @param str A text block; e.g. paragraph, table cell, tag\n * @return The resolved direction\n */\nfunction firstStrongCharDir(str) {\n var strongChar = firstStrongChar(str);\n if (strongChar == null) {\n return UnicodeBidiDirection.NEUTRAL;\n }\n return REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR;\n}\n\n/**\n * Returns the direction of a block of text, based on the direction of its\n * first strong character (has Bidi_Class value of L, R, or AL), or a fallback\n * direction, if no strong character is found.\n *\n * This function is supposed to be used in respect to Higher-Level Protocol\n * rule HL1. (http://www.unicode.org/reports/tr9/#HL1)\n *\n * @param str A text block; e.g. paragraph, table cell, tag\n * @param fallback Fallback direction, used if no strong direction detected\n * for the block (default = NEUTRAL)\n * @return The resolved direction\n */\nfunction resolveBlockDir(str, fallback) {\n fallback = fallback || UnicodeBidiDirection.NEUTRAL;\n if (!str.length) {\n return fallback;\n }\n var blockDir = firstStrongCharDir(str);\n return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir;\n}\n\n/**\n * Returns the direction of a block of text, based on the direction of its\n * first strong character (has Bidi_Class value of L, R, or AL), or a fallback\n * direction, if no strong character is found.\n *\n * NOTE: This function is similar to resolveBlockDir(), but uses the global\n * direction as the fallback, so it *always* returns a Strong direction,\n * making it useful for integration in places that you need to make the final\n * decision, like setting some CSS class.\n *\n * This function is supposed to be used in respect to Higher-Level Protocol\n * rule HL1. (http://www.unicode.org/reports/tr9/#HL1)\n *\n * @param str A text block; e.g. paragraph, table cell\n * @param strongFallback Fallback direction, used if no strong direction\n * detected for the block (default = global direction)\n * @return The resolved Strong direction\n */\nfunction getDirection(str, strongFallback) {\n if (!strongFallback) {\n strongFallback = UnicodeBidiDirection.getGlobalDir();\n }\n !UnicodeBidiDirection.isStrong(strongFallback) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Fallback direction must be a strong direction') : invariant(false) : void 0;\n return resolveBlockDir(str, strongFallback);\n}\n\n/**\n * Returns true if getDirection(arguments...) returns LTR.\n *\n * @param str A text block; e.g. paragraph, table cell\n * @param strongFallback Fallback direction, used if no strong direction\n * detected for the block (default = global direction)\n * @return True if the resolved direction is LTR\n */\nfunction isDirectionLTR(str, strongFallback) {\n return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR;\n}\n\n/**\n * Returns true if getDirection(arguments...) returns RTL.\n *\n * @param str A text block; e.g. paragraph, table cell\n * @param strongFallback Fallback direction, used if no strong direction\n * detected for the block (default = global direction)\n * @return True if the resolved direction is RTL\n */\nfunction isDirectionRTL(str, strongFallback) {\n return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL;\n}\n\nvar UnicodeBidi = {\n firstStrongChar: firstStrongChar,\n firstStrongCharDir: firstStrongCharDir,\n resolveBlockDir: resolveBlockDir,\n getDirection: getDirection,\n isDirectionLTR: isDirectionLTR,\n isDirectionRTL: isDirectionRTL\n};\n\nmodule.exports = UnicodeBidi;"},{"id":33,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/Keys.js","name":"./node_modules/fbjs/lib/Keys.js","index":50,"index2":47,"size":505,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDefaultKeyBinding.js","issuerId":67,"issuerName":"./lib/getDefaultKeyBinding.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":67,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDefaultKeyBinding.js","module":"./lib/getDefaultKeyBinding.js","moduleName":"./lib/getDefaultKeyBinding.js","type":"cjs require","userRequest":"fbjs/lib/Keys","loc":"16:11-35"},{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"fbjs/lib/Keys","loc":"17:11-35"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"fbjs/lib/Keys","loc":"18:11-35"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nmodule.exports = {\n BACKSPACE: 8,\n TAB: 9,\n RETURN: 13,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46,\n COMMA: 188,\n PERIOD: 190,\n A: 65,\n Z: 90,\n ZERO: 48,\n NUMPAD_0: 96,\n NUMPAD_9: 105\n};"},{"id":34,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getEntityKeyForSelection.js","name":"./lib/getEntityKeyForSelection.js","index":51,"index2":48,"size":1784,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","issuerId":88,"issuerName":"./lib/DraftEditorCompositionHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./getEntityKeyForSelection","loc":"19:31-68"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"./getEntityKeyForSelection","loc":"19:31-68"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./getEntityKeyForSelection","loc":"23:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Return the entity key that should be used when inserting text for the\n * specified target selection, only if the entity is `MUTABLE`. `IMMUTABLE`\n * and `SEGMENTED` entities should not be used for insertion behavior.\n */\nfunction getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey = void 0;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}\n\n/**\n * Determine whether an entity key corresponds to a `MUTABLE` entity. If so,\n * return it. If not, return null.\n */\nfunction filterKey(entityMap, entityKey) {\n if (entityKey) {\n var entity = entityMap.__get(entityKey);\n return entity.getMutability() === 'MUTABLE' ? entityKey : null;\n }\n return null;\n}\n\nmodule.exports = getEntityKeyForSelection;"},{"id":35,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/containsNode.js","name":"./node_modules/fbjs/lib/containsNode.js","index":73,"index2":67,"size":923,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","issuerId":120,"issuerName":"./lib/editOnBlur.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":101,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","module":"./lib/setDraftEditorSelection.js","moduleName":"./lib/setDraftEditorSelection.js","type":"cjs require","userRequest":"fbjs/lib/containsNode","loc":"17:19-51"},{"moduleId":107,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getElementRect.js","module":"./node_modules/fbjs/lib/getElementRect.js","moduleName":"./node_modules/fbjs/lib/getElementRect.js","type":"cjs require","userRequest":"./containsNode","loc":"12:19-44"},{"moduleId":120,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","module":"./lib/editOnBlur.js","moduleName":"./lib/editOnBlur.js","type":"cjs require","userRequest":"fbjs/lib/containsNode","loc":"17:19-51"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar isTextNode = require('./isTextNode');\n\n/*eslint-disable no-bitwise */\n\n/**\n * Checks if a given DOM node contains or is another DOM node.\n */\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nmodule.exports = containsNode;"},{"id":36,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/Scroll.js","name":"./node_modules/fbjs/lib/Scroll.js","index":77,"index2":72,"size":2466,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/Scroll","loc":"29:13-39"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"fbjs/lib/Scroll","loc":"37:13-39"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/Scroll","loc":"36:13-39"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * @param {DOMElement} element\n * @param {DOMDocument} doc\n * @return {boolean}\n */\nfunction _isViewportScrollElement(element, doc) {\n return !!doc && (element === doc.documentElement || element === doc.body);\n}\n\n/**\n * Scroll Module. This class contains 4 simple static functions\n * to be used to access Element.scrollTop/scrollLeft properties.\n * To solve the inconsistencies between browsers when either\n * document.body or document.documentElement is supplied,\n * below logic will be used to alleviate the issue:\n *\n * 1. If 'element' is either 'document.body' or 'document.documentElement,\n * get whichever element's 'scroll{Top,Left}' is larger.\n * 2. If 'element' is either 'document.body' or 'document.documentElement',\n * set the 'scroll{Top,Left}' on both elements.\n */\n\nvar Scroll = {\n /**\n * @param {DOMElement} element\n * @return {number}\n */\n getTop: function getTop(element) {\n var doc = element.ownerDocument;\n return _isViewportScrollElement(element, doc) ?\n // In practice, they will either both have the same value,\n // or one will be zero and the other will be the scroll position\n // of the viewport. So we can use `X || Y` instead of `Math.max(X, Y)`\n doc.body.scrollTop || doc.documentElement.scrollTop : element.scrollTop;\n },\n\n /**\n * @param {DOMElement} element\n * @param {number} newTop\n */\n setTop: function setTop(element, newTop) {\n var doc = element.ownerDocument;\n if (_isViewportScrollElement(element, doc)) {\n doc.body.scrollTop = doc.documentElement.scrollTop = newTop;\n } else {\n element.scrollTop = newTop;\n }\n },\n\n /**\n * @param {DOMElement} element\n * @return {number}\n */\n getLeft: function getLeft(element) {\n var doc = element.ownerDocument;\n return _isViewportScrollElement(element, doc) ? doc.body.scrollLeft || doc.documentElement.scrollLeft : element.scrollLeft;\n },\n\n /**\n * @param {DOMElement} element\n * @param {number} newLeft\n */\n setLeft: function setLeft(element, newLeft) {\n var doc = element.ownerDocument;\n if (_isViewportScrollElement(element, doc)) {\n doc.body.scrollLeft = doc.documentElement.scrollLeft = newLeft;\n } else {\n element.scrollLeft = newLeft;\n }\n }\n};\n\nmodule.exports = Scroll;"},{"id":37,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/findAncestorOffsetKey.js","name":"./lib/findAncestorOffsetKey.js","index":95,"index2":93,"size":839,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","issuerId":112,"issuerName":"./lib/DraftEditorDragHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":60,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","module":"./lib/getDraftEditorSelectionWithNodes.js","moduleName":"./lib/getDraftEditorSelectionWithNodes.js","type":"cjs require","userRequest":"./findAncestorOffsetKey","loc":"15:28-62"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./findAncestorOffsetKey","loc":"19:28-62"},{"moduleId":127,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnInput.js","module":"./lib/editOnInput.js","moduleName":"./lib/editOnInput.js","type":"cjs require","userRequest":"./findAncestorOffsetKey","loc":"20:28-62"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar getSelectionOffsetKeyForNode = require('./getSelectionOffsetKeyForNode');\n\n/**\n * Get the key from the node's nearest offset-aware ancestor.\n */\nfunction findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}\n\nmodule.exports = findAncestorOffsetKey;"},{"id":38,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/KeyBindingUtil.js","name":"./lib/KeyBindingUtil.js","index":114,"index2":110,"size":1080,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":67,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDefaultKeyBinding.js","module":"./lib/getDefaultKeyBinding.js","moduleName":"./lib/getDefaultKeyBinding.js","type":"cjs require","userRequest":"./KeyBindingUtil","loc":"15:21-48"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./KeyBindingUtil","loc":"29:21-48"},{"moduleId":128,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnKeyDown.js","module":"./lib/editOnKeyDown.js","moduleName":"./lib/editOnKeyDown.js","type":"cjs require","userRequest":"./KeyBindingUtil","loc":"17:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar isOSX = UserAgent.isPlatform('Mac OS X');\n\nvar KeyBindingUtil = {\n /**\n * Check whether the ctrlKey modifier is *not* being used in conjunction with\n * the altKey modifier. If they are combined, the result is an `altGraph`\n * key modifier, which should not be handled by this set of key bindings.\n */\n isCtrlKeyCommand: function isCtrlKeyCommand(e) {\n return !!e.ctrlKey && !e.altKey;\n },\n\n isOptionKeyCommand: function isOptionKeyCommand(e) {\n return isOSX && e.altKey;\n },\n\n hasCommandModifier: function hasCommandModifier(e) {\n return isOSX ? !!e.metaKey && !e.altKey : KeyBindingUtil.isCtrlKeyCommand(e);\n }\n};\n\nmodule.exports = KeyBindingUtil;"},{"id":39,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveSelectionBackward.js","name":"./lib/moveSelectionBackward.js","index":121,"index2":116,"size":1455,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","issuerId":130,"issuerName":"./lib/keyCommandBackspaceToStartOfLine.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":130,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","module":"./lib/keyCommandBackspaceToStartOfLine.js","moduleName":"./lib/keyCommandBackspaceToStartOfLine.js","type":"cjs require","userRequest":"./moveSelectionBackward","loc":"19:28-62"},{"moduleId":132,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceWord.js","module":"./lib/keyCommandBackspaceWord.js","moduleName":"./lib/keyCommandBackspaceWord.js","type":"cjs require","userRequest":"./moveSelectionBackward","loc":"18:28-62"},{"moduleId":138,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainBackspace.js","module":"./lib/keyCommandPlainBackspace.js","moduleName":"./lib/keyCommandPlainBackspace.js","type":"cjs require","userRequest":"./moveSelectionBackward","loc":"18:28-62"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\n/**\n * Given a collapsed selection, move the focus `maxDistance` backward within\n * the selected block. If the selection will go beyond the start of the block,\n * move focus to the end of the previous block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\nfunction moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}\n\nmodule.exports = moveSelectionBackward;"},{"id":40,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getSafeBodyFromHTML.js","name":"./lib/getSafeBodyFromHTML.js","index":139,"index2":133,"size":1265,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","issuerId":65,"issuerName":"./lib/convertFromHTMLToContentBlocks2.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"./getSafeBodyFromHTML","loc":"36:26-58"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"./getSafeBodyFromHTML","loc":"39:26-58"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./getSafeBodyFromHTML","loc":"27:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar isOldIE = UserAgent.isBrowser('IE <= 9');\n\n// Provides a dom node that will not execute scripts\n// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation.createHTMLDocument\n// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/HTML_to_DOM\n\nfunction getSafeBodyFromHTML(html) {\n var doc = void 0;\n var root = null;\n // Provides a safe context\n if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('foo');\n !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n doc.documentElement.innerHTML = html;\n root = doc.getElementsByTagName('body')[0];\n }\n return root;\n}\n\nmodule.exports = getSafeBodyFromHTML;"},{"id":41,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/randomizeBlockMapKeys.js","name":"./lib/randomizeBlockMapKeys.js","index":18,"index2":15,"size":3694,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getContentStateFragment.js","issuerId":24,"issuerName":"./lib/getContentStateFragment.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":24,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getContentStateFragment.js","module":"./lib/getContentStateFragment.js","moduleName":"./lib/getContentStateFragment.js","type":"cjs require","userRequest":"./randomizeBlockMapKeys","loc":"15:28-62"},{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"./randomizeBlockMapKeys","loc":"21:28-62"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar generateRandomKey = require('./generateRandomKey');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar randomizeContentBlockNodeKeys = function randomizeContentBlockNodeKeys(blockMap) {\n var newKeysRef = {};\n\n // we keep track of root blocks in order to update subsequent sibling links\n var lastRootBlock = void 0;\n\n return OrderedMap(blockMap.withMutations(function (blockMapState) {\n blockMapState.forEach(function (block, index) {\n var oldKey = block.getKey();\n var nextKey = block.getNextSiblingKey();\n var prevKey = block.getPrevSiblingKey();\n var childrenKeys = block.getChildKeys();\n var parentKey = block.getParentKey();\n\n // new key that we will use to build linking\n var key = generateRandomKey();\n\n // we will add it here to re-use it later\n newKeysRef[oldKey] = key;\n\n if (nextKey) {\n var nextBlock = blockMapState.get(nextKey);\n if (nextBlock) {\n blockMapState.setIn([nextKey, 'prevSibling'], key);\n } else {\n // this can happen when generating random keys for fragments\n blockMapState.setIn([oldKey, 'nextSibling'], null);\n }\n }\n\n if (prevKey) {\n var prevBlock = blockMapState.get(prevKey);\n if (prevBlock) {\n blockMapState.setIn([prevKey, 'nextSibling'], key);\n } else {\n // this can happen when generating random keys for fragments\n blockMapState.setIn([oldKey, 'prevSibling'], null);\n }\n }\n\n if (parentKey && blockMapState.get(parentKey)) {\n var parentBlock = blockMapState.get(parentKey);\n var parentChildrenList = parentBlock.getChildKeys();\n blockMapState.setIn([parentKey, 'children'], parentChildrenList.set(parentChildrenList.indexOf(block.getKey()), key));\n } else {\n // blocks will then be treated as root block nodes\n blockMapState.setIn([oldKey, 'parent'], null);\n\n if (lastRootBlock) {\n blockMapState.setIn([lastRootBlock.getKey(), 'nextSibling'], key);\n blockMapState.setIn([oldKey, 'prevSibling'], newKeysRef[lastRootBlock.getKey()]);\n }\n\n lastRootBlock = blockMapState.get(oldKey);\n }\n\n childrenKeys.forEach(function (childKey) {\n var childBlock = blockMapState.get(childKey);\n if (childBlock) {\n blockMapState.setIn([childKey, 'parent'], key);\n } else {\n blockMapState.setIn([oldKey, 'children'], block.getChildKeys().filter(function (child) {\n return child !== childKey;\n }));\n }\n });\n });\n }).toArray().map(function (block) {\n return [newKeysRef[block.getKey()], block.set('key', newKeysRef[block.getKey()])];\n }));\n};\n\nvar randomizeContentBlockKeys = function randomizeContentBlockKeys(blockMap) {\n return OrderedMap(blockMap.toArray().map(function (block) {\n var key = generateRandomKey();\n return [key, block.set('key', key)];\n }));\n};\n\nvar randomizeBlockMapKeys = function randomizeBlockMapKeys(blockMap) {\n var isTreeBasedBlockMap = blockMap.first() instanceof ContentBlockNode;\n\n if (!isTreeBasedBlockMap) {\n return randomizeContentBlockKeys(blockMap);\n }\n\n return randomizeContentBlockNodeKeys(blockMap);\n};\n\nmodule.exports = randomizeBlockMapKeys;"},{"id":42,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeEntitiesAtEdges.js","name":"./lib/removeEntitiesAtEdges.js","index":20,"index2":16,"size":3915,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./removeEntitiesAtEdges","loc":"27:28-62"},{"moduleId":24,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getContentStateFragment.js","module":"./lib/getContentStateFragment.js","moduleName":"./lib/getContentStateFragment.js","type":"cjs require","userRequest":"./removeEntitiesAtEdges","loc":"16:28-62"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nvar findRangesImmutable = require('./findRangesImmutable');\nvar invariant = require('fbjs/lib/invariant');\n\nfunction removeEntitiesAtEdges(contentState, selectionState) {\n var blockMap = contentState.getBlockMap();\n var entityMap = contentState.getEntityMap();\n\n var updatedBlocks = {};\n\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var startBlock = blockMap.get(startKey);\n var updatedStart = removeForBlock(entityMap, startBlock, startOffset);\n\n if (updatedStart !== startBlock) {\n updatedBlocks[startKey] = updatedStart;\n }\n\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n var endBlock = blockMap.get(endKey);\n if (startKey === endKey) {\n endBlock = updatedStart;\n }\n\n var updatedEnd = removeForBlock(entityMap, endBlock, endOffset);\n\n if (updatedEnd !== endBlock) {\n updatedBlocks[endKey] = updatedEnd;\n }\n\n if (!Object.keys(updatedBlocks).length) {\n return contentState.set('selectionAfter', selectionState);\n }\n\n return contentState.merge({\n blockMap: blockMap.merge(updatedBlocks),\n selectionAfter: selectionState\n });\n}\n\n/**\n * Given a list of characters and an offset that is in the middle of an entity,\n * returns the start and end of the entity that is overlapping the offset.\n * Note: This method requires that the offset be in an entity range.\n */\nfunction getRemovalRange(characters, entityKey, offset) {\n var removalRange = void 0;\n\n // Iterates through a list looking for ranges of matching items\n // based on the 'isEqual' callback.\n // Then instead of returning the result, call the 'found' callback\n // with each range.\n // Then filters those ranges based on the 'filter' callback\n //\n // Here we use it to find ranges of characters with the same entity key.\n findRangesImmutable(characters, // the list to iterate through\n function (a, b) {\n return a.getEntity() === b.getEntity();\n }, // 'isEqual' callback\n function (element) {\n return element.getEntity() === entityKey;\n }, // 'filter' callback\n function (start, end) {\n // 'found' callback\n if (start <= offset && end >= offset) {\n // this entity overlaps the offset index\n removalRange = { start: start, end: end };\n }\n });\n !(typeof removalRange === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Removal range must exist within character list.') : invariant(false) : void 0;\n return removalRange;\n}\n\nfunction removeForBlock(entityMap, block, offset) {\n var chars = block.getCharacterList();\n var charBefore = offset > 0 ? chars.get(offset - 1) : undefined;\n var charAfter = offset < chars.count() ? chars.get(offset) : undefined;\n var entityBeforeCursor = charBefore ? charBefore.getEntity() : undefined;\n var entityAfterCursor = charAfter ? charAfter.getEntity() : undefined;\n\n if (entityAfterCursor && entityAfterCursor === entityBeforeCursor) {\n var entity = entityMap.__get(entityAfterCursor);\n if (entity.getMutability() !== 'MUTABLE') {\n var _getRemovalRange = getRemovalRange(chars, entityAfterCursor, offset),\n _start = _getRemovalRange.start,\n _end = _getRemovalRange.end;\n\n var current = void 0;\n while (_start < _end) {\n current = chars.get(_start);\n chars = chars.set(_start, CharacterMetadata.applyEntity(current, null));\n _start++;\n }\n return block.set('characterList', chars);\n }\n }\n\n return block;\n}\n\nmodule.exports = removeEntitiesAtEdges;"},{"id":43,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertIntoList.js","name":"./lib/insertIntoList.js","index":23,"index2":19,"size":936,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","issuerId":77,"issuerName":"./lib/insertFragmentIntoContentState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":77,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","module":"./lib/insertFragmentIntoContentState.js","moduleName":"./lib/insertFragmentIntoContentState.js","type":"cjs require","userRequest":"./insertIntoList","loc":"19:21-48"},{"moduleId":78,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertTextIntoContentState.js","module":"./lib/insertTextIntoContentState.js","moduleName":"./lib/insertTextIntoContentState.js","type":"cjs require","userRequest":"./insertIntoList","loc":"17:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Maintain persistence for target list when appending and prepending.\n */\nfunction insertIntoList(targetList, toInsert, offset) {\n if (offset === targetList.count()) {\n toInsert.forEach(function (c) {\n targetList = targetList.push(c);\n });\n } else if (offset === 0) {\n toInsert.reverse().forEach(function (c) {\n targetList = targetList.unshift(c);\n });\n } else {\n var head = targetList.slice(0, offset);\n var tail = targetList.slice(offset);\n targetList = head.concat(toInsert, tail).toList();\n }\n return targetList;\n}\n\nmodule.exports = insertIntoList;"},{"id":44,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getNextDelimiterBlockKey.js","name":"./lib/getNextDelimiterBlockKey.js","index":27,"index2":23,"size":1367,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","issuerId":85,"issuerName":"./lib/moveBlockInContentState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":80,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeRangeFromContentState.js","module":"./lib/removeRangeFromContentState.js","moduleName":"./lib/removeRangeFromContentState.js","type":"cjs require","userRequest":"./getNextDelimiterBlockKey","loc":"18:31-68"},{"moduleId":85,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","module":"./lib/moveBlockInContentState.js","moduleName":"./lib/moveBlockInContentState.js","type":"cjs require","userRequest":"./getNextDelimiterBlockKey","loc":"18:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\nvar ContentBlockNode = require('./ContentBlockNode');\n\nvar getNextDelimiterBlockKey = function getNextDelimiterBlockKey(block, blockMap) {\n var isExperimentalTreeBlock = block instanceof ContentBlockNode;\n\n if (!isExperimentalTreeBlock) {\n return null;\n }\n\n var nextSiblingKey = block.getNextSiblingKey();\n\n if (nextSiblingKey) {\n return nextSiblingKey;\n }\n\n var parent = block.getParentKey();\n\n if (!parent) {\n return null;\n }\n\n var nextNonDescendantBlock = blockMap.get(parent);\n while (nextNonDescendantBlock && !nextNonDescendantBlock.getNextSiblingKey()) {\n var parentKey = nextNonDescendantBlock.getParentKey();\n nextNonDescendantBlock = parentKey ? blockMap.get(parentKey) : null;\n }\n\n if (!nextNonDescendantBlock) {\n return null;\n }\n\n return nextNonDescendantBlock.getNextSiblingKey();\n};\n\nmodule.exports = getNextDelimiterBlockKey;"},{"id":45,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntityInstance.js","name":"./lib/DraftEntityInstance.js","index":34,"index2":29,"size":2646,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":21,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntity.js","module":"./lib/DraftEntity.js","moduleName":"./lib/DraftEntity.js","type":"cjs require","userRequest":"./DraftEntityInstance","loc":"19:26-58"},{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DraftEntityInstance","loc":"27:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @legacyServerCallableInstance\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar Immutable = require('immutable');\n\nvar Record = Immutable.Record;\n\n\nvar DraftEntityInstanceRecord = Record({\n type: 'TOKEN',\n mutability: 'IMMUTABLE',\n data: Object\n});\n\n/**\n * An instance of a document entity, consisting of a `type` and relevant\n * `data`, metadata about the entity.\n *\n * For instance, a \"link\" entity might provide a URI, and a \"mention\"\n * entity might provide the mentioned user's ID. These pieces of data\n * may be used when rendering the entity as part of a ContentBlock DOM\n * representation. For a link, the data would be used as an href for\n * the rendered anchor. For a mention, the ID could be used to retrieve\n * a hovercard.\n */\n\nvar DraftEntityInstance = function (_DraftEntityInstanceR) {\n _inherits(DraftEntityInstance, _DraftEntityInstanceR);\n\n function DraftEntityInstance() {\n _classCallCheck(this, DraftEntityInstance);\n\n return _possibleConstructorReturn(this, _DraftEntityInstanceR.apply(this, arguments));\n }\n\n DraftEntityInstance.prototype.getType = function getType() {\n return this.get('type');\n };\n\n DraftEntityInstance.prototype.getMutability = function getMutability() {\n return this.get('mutability');\n };\n\n DraftEntityInstance.prototype.getData = function getData() {\n return this.get('data');\n };\n\n return DraftEntityInstance;\n}(DraftEntityInstanceRecord);\n\nmodule.exports = DraftEntityInstance;"},{"id":46,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DefaultDraftInlineStyle.js","name":"./lib/DefaultDraftInlineStyle.js","index":47,"index2":46,"size":635,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DefaultDraftInlineStyle","loc":"22:30-66"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DefaultDraftInlineStyle","loc":"27:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict\n */\n\n'use strict';\n\nmodule.exports = {\n BOLD: {\n fontWeight: 'bold'\n },\n\n CODE: {\n fontFamily: 'monospace',\n wordWrap: 'break-word'\n },\n\n ITALIC: {\n fontStyle: 'italic'\n },\n\n STRIKETHROUGH: {\n textDecoration: 'line-through'\n },\n\n UNDERLINE: {\n textDecoration: 'underline'\n }\n};"},{"id":47,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/isSelectionAtLeafStart.js","name":"./lib/isSelectionAtLeafStart.js","index":53,"index2":50,"size":1114,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","issuerId":88,"issuerName":"./lib/DraftEditorCompositionHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":88,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","module":"./lib/DraftEditorCompositionHandler.js","moduleName":"./lib/DraftEditorCompositionHandler.js","type":"cjs require","userRequest":"./isSelectionAtLeafStart","loc":"22:29-64"},{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"./isSelectionAtLeafStart","loc":"21:29-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nfunction isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}\n\nmodule.exports = isSelectionAtLeafStart;"},{"id":48,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","name":"./lib/DraftEditorLeaf.react.js","index":60,"index2":70,"size":6337,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"./DraftEditorLeaf.react","loc":"25:22-56"},{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"./DraftEditorLeaf.react","loc":"25:22-56"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorTextNode = require('./DraftEditorTextNode.react');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\n\nvar invariant = require('fbjs/lib/invariant');\nvar setDraftEditorSelection = require('./setDraftEditorSelection');\n\n/**\n * All leaf nodes in the editor are spans with single text nodes. Leaf\n * elements are styled based on the merging of an optional custom style map\n * and a default style map.\n *\n * `DraftEditorLeaf` also provides a wrapper for calling into the imperative\n * DOM Selection API. In this way, top-level components can declaratively\n * maintain the selection state.\n */\nvar DraftEditorLeaf = function (_React$Component) {\n _inherits(DraftEditorLeaf, _React$Component);\n\n function DraftEditorLeaf() {\n _classCallCheck(this, DraftEditorLeaf);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorLeaf.prototype._setSelection = function _setSelection() {\n var selection = this.props.selection;\n\n // If selection state is irrelevant to the parent block, no-op.\n\n if (selection == null || !selection.getHasFocus()) {\n return;\n }\n\n var _props = this.props,\n block = _props.block,\n start = _props.start,\n text = _props.text;\n\n var blockKey = block.getKey();\n var end = start + text.length;\n if (!selection.hasEdgeWithin(blockKey, start, end)) {\n return;\n }\n\n // Determine the appropriate target node for selection. If the child\n // is not a text node, it is a
spacer. In this case, use the\n // itself as the selection target.\n var node = ReactDOM.findDOMNode(this);\n !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing node') : invariant(false) : void 0;\n var child = node.firstChild;\n !child ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing child') : invariant(false) : void 0;\n var targetNode = void 0;\n\n if (child.nodeType === Node.TEXT_NODE) {\n targetNode = child;\n } else if (child.tagName === 'BR') {\n targetNode = node;\n } else {\n targetNode = child.firstChild;\n !targetNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing targetNode') : invariant(false) : void 0;\n }\n\n setDraftEditorSelection(selection, targetNode, blockKey, start, end);\n };\n /**\n * By making individual leaf instances aware of their context within\n * the text of the editor, we can set our selection range more\n * easily than we could in the non-React world.\n *\n * Note that this depends on our maintaining tight control over the\n * DOM structure of the DraftEditor component. If leaves had multiple\n * text nodes, this would be harder.\n */\n\n DraftEditorLeaf.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var leafNode = ReactDOM.findDOMNode(this.leaf);\n !leafNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing leafNode') : invariant(false) : void 0;\n var shouldUpdate = leafNode.textContent !== nextProps.text || nextProps.styleSet !== this.props.styleSet || nextProps.forceSelection;\n return shouldUpdate;\n };\n\n DraftEditorLeaf.prototype.componentDidUpdate = function componentDidUpdate() {\n this._setSelection();\n };\n\n DraftEditorLeaf.prototype.componentDidMount = function componentDidMount() {\n this._setSelection();\n };\n\n DraftEditorLeaf.prototype.render = function render() {\n var _this2 = this;\n\n var block = this.props.block;\n var text = this.props.text;\n\n // If the leaf is at the end of its block and ends in a soft newline, append\n // an extra line feed character. Browsers collapse trailing newline\n // characters, which leaves the cursor in the wrong place after a\n // shift+enter. The extra character repairs this.\n\n if (text.endsWith('\\n') && this.props.isLast) {\n text += '\\n';\n }\n\n var _props2 = this.props,\n customStyleMap = _props2.customStyleMap,\n customStyleFn = _props2.customStyleFn,\n offsetKey = _props2.offsetKey,\n styleSet = _props2.styleSet;\n\n var styleObj = styleSet.reduce(function (map, styleName) {\n var mergedStyles = {};\n var style = customStyleMap[styleName];\n\n if (style !== undefined && map.textDecoration !== style.textDecoration) {\n // .trim() is necessary for IE9/10/11 and Edge\n mergedStyles.textDecoration = [map.textDecoration, style.textDecoration].join(' ').trim();\n }\n\n return _assign(map, style, mergedStyles);\n }, {});\n\n if (customStyleFn) {\n var newStyles = customStyleFn(styleSet, block);\n styleObj = _assign(styleObj, newStyles);\n }\n\n return React.createElement(\n 'span',\n {\n 'data-offset-key': offsetKey,\n ref: function ref(_ref) {\n return _this2.leaf = _ref;\n },\n style: styleObj },\n React.createElement(\n DraftEditorTextNode,\n null,\n text\n )\n );\n };\n\n return DraftEditorLeaf;\n}(React.Component);\n\nmodule.exports = DraftEditorLeaf;"},{"id":49,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftJsDebugLogging.js","name":"./lib/DraftJsDebugLogging.js","index":72,"index2":64,"size":524,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnSelect.js","issuerId":146,"issuerName":"./lib/editOnSelect.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":101,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","module":"./lib/setDraftEditorSelection.js","moduleName":"./lib/setDraftEditorSelection.js","type":"cjs require","userRequest":"./DraftJsDebugLogging","loc":"15:26-58"},{"moduleId":146,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnSelect.js","module":"./lib/editOnSelect.js","moduleName":"./lib/editOnSelect.js","type":"cjs require","userRequest":"./DraftJsDebugLogging","loc":"15:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nmodule.exports = {\n logBlockedSelectionEvent: function logBlockedSelectionEvent() {\n return null;\n },\n logSelectionStateFailure: function logSelectionStateFailure() {\n return null;\n }\n};"},{"id":50,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getActiveElement.js","name":"./node_modules/fbjs/lib/getActiveElement.js","index":76,"index2":68,"size":912,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","issuerId":120,"issuerName":"./lib/editOnBlur.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":101,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","module":"./lib/setDraftEditorSelection.js","moduleName":"./lib/setDraftEditorSelection.js","type":"cjs require","userRequest":"fbjs/lib/getActiveElement","loc":"18:23-59"},{"moduleId":120,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBlur.js","module":"./lib/editOnBlur.js","moduleName":"./lib/editOnBlur.js","type":"cjs require","userRequest":"fbjs/lib/getActiveElement","loc":"18:23-59"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/* eslint-disable fb-www/typeof-undefined */\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n *\n * The activeElement will be null only if the document or document body is not\n * yet defined.\n *\n * @param {?DOMDocument} doc Defaults to current document.\n * @return {?DOMElement}\n */\nfunction getActiveElement(doc) /*?DOMElement*/{\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n if (typeof doc === 'undefined') {\n return null;\n }\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\nmodule.exports = getActiveElement;"},{"id":51,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getElementPosition.js","name":"./node_modules/fbjs/lib/getElementPosition.js","index":82,"index2":78,"size":714,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/getElementPosition","loc":"35:25-63"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/getElementPosition","loc":"39:25-63"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar getElementRect = require('./getElementRect');\n\n/**\n * Gets an element's position in pixels relative to the viewport. The returned\n * object represents the position of the element's top left corner.\n *\n * @param {DOMElement} element\n * @return {object}\n */\nfunction getElementPosition(element) {\n var rect = getElementRect(element);\n return {\n x: rect.left,\n y: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n}\n\nmodule.exports = getElementPosition;"},{"id":52,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getViewportDimensions.js","name":"./node_modules/fbjs/lib/getViewportDimensions.js","index":87,"index2":82,"size":1198,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","issuerId":53,"issuerName":"./lib/DraftEditorBlock.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":53,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","module":"./lib/DraftEditorBlock.react.js","moduleName":"./lib/DraftEditorBlock.react.js","type":"cjs require","userRequest":"fbjs/lib/getViewportDimensions","loc":"37:28-69"},{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"fbjs/lib/getViewportDimensions","loc":"41:28-69"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\n\nfunction getViewportWidth() {\n var width = void 0;\n if (document.documentElement) {\n width = document.documentElement.clientWidth;\n }\n\n if (!width && document.body) {\n width = document.body.clientWidth;\n }\n\n return width || 0;\n} /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @typechecks\n */\n\nfunction getViewportHeight() {\n var height = void 0;\n if (document.documentElement) {\n height = document.documentElement.clientHeight;\n }\n\n if (!height && document.body) {\n height = document.body.clientHeight;\n }\n\n return height || 0;\n}\n\n/**\n * Gets the viewport dimensions including any scrollbars.\n */\nfunction getViewportDimensions() {\n return {\n width: window.innerWidth || getViewportWidth(),\n height: window.innerHeight || getViewportHeight()\n };\n}\n\n/**\n * Gets the viewport dimensions excluding any scrollbars.\n */\ngetViewportDimensions.withoutScrollbars = function () {\n return {\n width: getViewportWidth(),\n height: getViewportHeight()\n };\n};\n\nmodule.exports = getViewportDimensions;"},{"id":53,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlock.react.js","name":"./lib/DraftEditorBlock.react.js","index":89,"index2":85,"size":8667,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DraftEditorBlock.react","loc":"24:23-58"},{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"./DraftEditorBlock.react","loc":"25:23-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorLeaf = require('./DraftEditorLeaf.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar Scroll = require('fbjs/lib/Scroll');\nvar Style = require('fbjs/lib/Style');\nvar UnicodeBidi = require('fbjs/lib/UnicodeBidi');\nvar UnicodeBidiDirection = require('fbjs/lib/UnicodeBidiDirection');\n\nvar cx = require('fbjs/lib/cx');\nvar getElementPosition = require('fbjs/lib/getElementPosition');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\nvar getViewportDimensions = require('fbjs/lib/getViewportDimensions');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar SCROLL_BUFFER = 10;\n\n/**\n * Return whether a block overlaps with either edge of the `SelectionState`.\n */\nvar isBlockOnSelectionEdge = function isBlockOnSelectionEdge(selection, key) {\n return selection.getAnchorKey() === key || selection.getFocusKey() === key;\n};\n\n/**\n * The default block renderer for a `DraftEditor` component.\n *\n * A `DraftEditorBlock` is able to render a given `ContentBlock` to its\n * appropriate decorator and inline style components.\n */\n\nvar DraftEditorBlock = function (_React$Component) {\n _inherits(DraftEditorBlock, _React$Component);\n\n function DraftEditorBlock() {\n _classCallCheck(this, DraftEditorBlock);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorBlock.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n return this.props.block !== nextProps.block || this.props.tree !== nextProps.tree || this.props.direction !== nextProps.direction || isBlockOnSelectionEdge(nextProps.selection, nextProps.block.getKey()) && nextProps.forceSelection;\n };\n\n /**\n * When a block is mounted and overlaps the selection state, we need to make\n * sure that the cursor is visible to match native behavior. This may not\n * be the case if the user has pressed `RETURN` or pasted some content, since\n * programatically creating these new blocks and setting the DOM selection\n * will miss out on the browser natively scrolling to that position.\n *\n * To replicate native behavior, if the block overlaps the selection state\n * on mount, force the scroll position. Check the scroll state of the scroll\n * parent, and adjust it to align the entire block to the bottom of the\n * scroll parent.\n */\n\n\n DraftEditorBlock.prototype.componentDidMount = function componentDidMount() {\n var selection = this.props.selection;\n var endKey = selection.getEndKey();\n if (!selection.getHasFocus() || endKey !== this.props.block.getKey()) {\n return;\n }\n\n var blockNode = ReactDOM.findDOMNode(this);\n var scrollParent = Style.getScrollParent(blockNode);\n var scrollPosition = getScrollPosition(scrollParent);\n var scrollDelta = void 0;\n\n if (scrollParent === window) {\n var nodePosition = getElementPosition(blockNode);\n var nodeBottom = nodePosition.y + nodePosition.height;\n var viewportHeight = getViewportDimensions().height;\n scrollDelta = nodeBottom - viewportHeight;\n if (scrollDelta > 0) {\n window.scrollTo(scrollPosition.x, scrollPosition.y + scrollDelta + SCROLL_BUFFER);\n }\n } else {\n !(blockNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'blockNode is not an HTMLElement') : invariant(false) : void 0;\n var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;\n var scrollBottom = scrollParent.offsetHeight + scrollPosition.y;\n scrollDelta = blockBottom - scrollBottom;\n if (scrollDelta > 0) {\n Scroll.setTop(scrollParent, Scroll.getTop(scrollParent) + scrollDelta + SCROLL_BUFFER);\n }\n }\n };\n\n DraftEditorBlock.prototype._renderChildren = function _renderChildren() {\n var _this2 = this;\n\n var block = this.props.block;\n var blockKey = block.getKey();\n var text = block.getText();\n var lastLeafSet = this.props.tree.size - 1;\n var hasSelection = isBlockOnSelectionEdge(this.props.selection, blockKey);\n\n return this.props.tree.map(function (leafSet, ii) {\n var leavesForLeafSet = leafSet.get('leaves');\n var lastLeaf = leavesForLeafSet.size - 1;\n var leaves = leavesForLeafSet.map(function (leaf, jj) {\n var offsetKey = DraftOffsetKey.encode(blockKey, ii, jj);\n var start = leaf.get('start');\n var end = leaf.get('end');\n return React.createElement(DraftEditorLeaf, {\n key: offsetKey,\n offsetKey: offsetKey,\n block: block,\n start: start,\n selection: hasSelection ? _this2.props.selection : null,\n forceSelection: _this2.props.forceSelection,\n text: text.slice(start, end),\n styleSet: block.getInlineStyleAt(start),\n customStyleMap: _this2.props.customStyleMap,\n customStyleFn: _this2.props.customStyleFn,\n isLast: ii === lastLeafSet && jj === lastLeaf\n });\n }).toArray();\n\n var decoratorKey = leafSet.get('decoratorKey');\n if (decoratorKey == null) {\n return leaves;\n }\n\n if (!_this2.props.decorator) {\n return leaves;\n }\n\n var decorator = nullthrows(_this2.props.decorator);\n\n var DecoratorComponent = decorator.getComponentForKey(decoratorKey);\n if (!DecoratorComponent) {\n return leaves;\n }\n\n var decoratorProps = decorator.getPropsForKey(decoratorKey);\n var decoratorOffsetKey = DraftOffsetKey.encode(blockKey, ii, 0);\n var start = leavesForLeafSet.first().get('start');\n var end = leavesForLeafSet.last().get('end');\n var decoratedText = text.slice(start, end);\n var entityKey = block.getEntityAt(leafSet.get('start'));\n\n // Resetting dir to the same value on a child node makes Chrome/Firefox\n // confused on cursor movement. See http://jsfiddle.net/d157kLck/3/\n var dir = UnicodeBidiDirection.getHTMLDirIfDifferent(UnicodeBidi.getDirection(decoratedText), _this2.props.direction);\n\n var commonProps = {\n contentState: _this2.props.contentState,\n decoratedText: decoratedText,\n dir: dir,\n key: decoratorOffsetKey,\n start: start,\n end: end,\n blockKey: blockKey,\n entityKey: entityKey,\n offsetKey: decoratorOffsetKey\n };\n\n return React.createElement(\n DecoratorComponent,\n _extends({}, decoratorProps, commonProps),\n leaves\n );\n }).toArray();\n };\n\n DraftEditorBlock.prototype.render = function render() {\n var _props = this.props,\n direction = _props.direction,\n offsetKey = _props.offsetKey;\n\n var className = cx({\n 'public/DraftStyleDefault/block': true,\n 'public/DraftStyleDefault/ltr': direction === 'LTR',\n 'public/DraftStyleDefault/rtl': direction === 'RTL'\n });\n\n return React.createElement(\n 'div',\n { 'data-offset-key': offsetKey, className: className },\n this._renderChildren()\n );\n };\n\n return DraftEditorBlock;\n}(React.Component);\n\nmodule.exports = DraftEditorBlock;"},{"id":54,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","name":"./node_modules/fbjs/lib/DataTransfer.js","index":92,"index2":91,"size":5160,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","issuerId":112,"issuerName":"./lib/DraftEditorDragHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"fbjs/lib/DataTransfer","loc":"15:19-51"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"fbjs/lib/DataTransfer","loc":"17:19-51"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar PhotosMimeType = require('./PhotosMimeType');\n\nvar createArrayFromMixed = require('./createArrayFromMixed');\nvar emptyFunction = require('./emptyFunction');\n\nvar CR_LF_REGEX = new RegExp('\\r\\n', 'g');\nvar LF_ONLY = '\\n';\n\nvar RICH_TEXT_TYPES = {\n 'text/rtf': 1,\n 'text/html': 1\n};\n\n/**\n * If DataTransferItem is a file then return the Blob of data.\n *\n * @param {object} item\n * @return {?blob}\n */\nfunction getFileFromDataTransfer(item) {\n if (item.kind == 'file') {\n return item.getAsFile();\n }\n}\n\nvar DataTransfer = function () {\n /**\n * @param {object} data\n */\n function DataTransfer(data) {\n _classCallCheck(this, DataTransfer);\n\n this.data = data;\n\n // Types could be DOMStringList or array\n this.types = data.types ? createArrayFromMixed(data.types) : [];\n }\n\n /**\n * Is this likely to be a rich text data transfer?\n *\n * @return {boolean}\n */\n\n\n DataTransfer.prototype.isRichText = function isRichText() {\n // If HTML is available, treat this data as rich text. This way, we avoid\n // using a pasted image if it is packaged with HTML -- this may occur with\n // pastes from MS Word, for example. However this is only rich text if\n // there's accompanying text.\n if (this.getHTML() && this.getText()) {\n return true;\n }\n\n // When an image is copied from a preview window, you end up with two\n // DataTransferItems one of which is a file's metadata as text. Skip those.\n if (this.isImage()) {\n return false;\n }\n\n return this.types.some(function (type) {\n return RICH_TEXT_TYPES[type];\n });\n };\n\n /**\n * Get raw text.\n *\n * @return {?string}\n */\n\n\n DataTransfer.prototype.getText = function getText() {\n var text;\n if (this.data.getData) {\n if (!this.types.length) {\n text = this.data.getData('Text');\n } else if (this.types.indexOf('text/plain') != -1) {\n text = this.data.getData('text/plain');\n }\n }\n return text ? text.replace(CR_LF_REGEX, LF_ONLY) : null;\n };\n\n /**\n * Get HTML paste data\n *\n * @return {?string}\n */\n\n\n DataTransfer.prototype.getHTML = function getHTML() {\n if (this.data.getData) {\n if (!this.types.length) {\n return this.data.getData('Text');\n } else if (this.types.indexOf('text/html') != -1) {\n return this.data.getData('text/html');\n }\n }\n };\n\n /**\n * Is this a link data transfer?\n *\n * @return {boolean}\n */\n\n\n DataTransfer.prototype.isLink = function isLink() {\n return this.types.some(function (type) {\n return type.indexOf('Url') != -1 || type.indexOf('text/uri-list') != -1 || type.indexOf('text/x-moz-url');\n });\n };\n\n /**\n * Get a link url.\n *\n * @return {?string}\n */\n\n\n DataTransfer.prototype.getLink = function getLink() {\n if (this.data.getData) {\n if (this.types.indexOf('text/x-moz-url') != -1) {\n var url = this.data.getData('text/x-moz-url').split('\\n');\n return url[0];\n }\n return this.types.indexOf('text/uri-list') != -1 ? this.data.getData('text/uri-list') : this.data.getData('url');\n }\n\n return null;\n };\n\n /**\n * Is this an image data transfer?\n *\n * @return {boolean}\n */\n\n\n DataTransfer.prototype.isImage = function isImage() {\n var isImage = this.types.some(function (type) {\n // Firefox will have a type of application/x-moz-file for images during\n // dragging\n return type.indexOf('application/x-moz-file') != -1;\n });\n\n if (isImage) {\n return true;\n }\n\n var items = this.getFiles();\n for (var i = 0; i < items.length; i++) {\n var type = items[i].type;\n if (!PhotosMimeType.isImage(type)) {\n return false;\n }\n }\n\n return true;\n };\n\n DataTransfer.prototype.getCount = function getCount() {\n if (this.data.hasOwnProperty('items')) {\n return this.data.items.length;\n } else if (this.data.hasOwnProperty('mozItemCount')) {\n return this.data.mozItemCount;\n } else if (this.data.files) {\n return this.data.files.length;\n }\n return null;\n };\n\n /**\n * Get files.\n *\n * @return {array}\n */\n\n\n DataTransfer.prototype.getFiles = function getFiles() {\n if (this.data.items) {\n // createArrayFromMixed doesn't properly handle DataTransferItemLists.\n return Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument);\n } else if (this.data.files) {\n return Array.prototype.slice.call(this.data.files);\n } else {\n return [];\n }\n };\n\n /**\n * Are there any files to fetch?\n *\n * @return {boolean}\n */\n\n\n DataTransfer.prototype.hasFiles = function hasFiles() {\n return this.getFiles().length > 0;\n };\n\n return DataTransfer;\n}();\n\nmodule.exports = DataTransfer;"},{"id":55,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getSelectionOffsetKeyForNode.js","name":"./lib/getSelectionOffsetKeyForNode.js","index":96,"index2":92,"size":936,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/findAncestorOffsetKey.js","issuerId":37,"issuerName":"./lib/findAncestorOffsetKey.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":37,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/findAncestorOffsetKey.js","module":"./lib/findAncestorOffsetKey.js","moduleName":"./lib/findAncestorOffsetKey.js","type":"cjs require","userRequest":"./getSelectionOffsetKeyForNode","loc":"15:35-76"},{"moduleId":60,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","module":"./lib/getDraftEditorSelectionWithNodes.js","moduleName":"./lib/getDraftEditorSelectionWithNodes.js","type":"cjs require","userRequest":"./getSelectionOffsetKeyForNode","loc":"16:35-76"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Get offset key from a node or it's child nodes. Return the first offset key\n * found on the DOM tree of given node.\n */\n\nfunction getSelectionOffsetKeyForNode(node) {\n if (node instanceof Element) {\n var offsetKey = node.getAttribute('data-offset-key');\n if (offsetKey) {\n return offsetKey;\n }\n for (var ii = 0; ii < node.childNodes.length; ii++) {\n var childOffsetKey = getSelectionOffsetKeyForNode(node.childNodes[ii]);\n if (childOffsetKey) {\n return childOffsetKey;\n }\n }\n }\n return null;\n}\n\nmodule.exports = getSelectionOffsetKeyForNode;"},{"id":56,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getTextContentFromFiles.js","name":"./lib/getTextContentFromFiles.js","index":97,"index2":94,"size":2195,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","issuerId":112,"issuerName":"./lib/DraftEditorDragHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./getTextContentFromFiles","loc":"20:30-66"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./getTextContentFromFiles","loc":"24:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar TEXT_CLIPPING_REGEX = /\\.textClipping$/;\n\nvar TEXT_TYPES = {\n 'text/plain': true,\n 'text/html': true,\n 'text/rtf': true\n};\n\n// Somewhat arbitrary upper bound on text size. Let's not lock up the browser.\nvar TEXT_SIZE_UPPER_BOUND = 5000;\n\n/**\n * Extract the text content from a file list.\n */\nfunction getTextContentFromFiles(files, callback) {\n var readCount = 0;\n var results = [];\n files.forEach(function ( /*blob*/file) {\n readFile(file, function ( /*string*/text) {\n readCount++;\n text && results.push(text.slice(0, TEXT_SIZE_UPPER_BOUND));\n if (readCount == files.length) {\n callback(results.join('\\r'));\n }\n });\n });\n}\n\n/**\n * todo isaac: Do work to turn html/rtf into a content fragment.\n */\nfunction readFile(file, callback) {\n if (!global.FileReader || file.type && !(file.type in TEXT_TYPES)) {\n callback('');\n return;\n }\n\n if (file.type === '') {\n var _contents = '';\n // Special-case text clippings, which have an empty type but include\n // `.textClipping` in the file name. `readAsText` results in an empty\n // string for text clippings, so we force the file name to serve\n // as the text value for the file.\n if (TEXT_CLIPPING_REGEX.test(file.name)) {\n _contents = file.name.replace(TEXT_CLIPPING_REGEX, '');\n }\n callback(_contents);\n return;\n }\n\n var reader = new FileReader();\n reader.onload = function () {\n var result = reader.result;\n !(typeof result === 'string') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'We should be calling \"FileReader.readAsText\" which returns a string') : invariant(false) : void 0;\n callback(result);\n };\n reader.onerror = function () {\n callback('');\n };\n reader.readAsText(file);\n}\n\nmodule.exports = getTextContentFromFiles;"},{"id":57,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getUpdatedSelectionState.js","name":"./lib/getUpdatedSelectionState.js","index":98,"index2":95,"size":2654,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","issuerId":112,"issuerName":"./lib/DraftEditorDragHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":60,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","module":"./lib/getDraftEditorSelectionWithNodes.js","moduleName":"./lib/getDraftEditorSelectionWithNodes.js","type":"cjs require","userRequest":"./getUpdatedSelectionState","loc":"17:31-68"},{"moduleId":112,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","module":"./lib/DraftEditorDragHandler.js","moduleName":"./lib/DraftEditorDragHandler.js","type":"cjs require","userRequest":"./getUpdatedSelectionState","loc":"21:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar DraftOffsetKey = require('./DraftOffsetKey');\n\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nfunction getUpdatedSelectionState(editorState, anchorKey, anchorOffset, focusKey, focusOffset) {\n var selection = nullthrows(editorState.getSelection());\n if (process.env.NODE_ENV !== 'production') {\n if (!anchorKey || !focusKey) {\n /*eslint-disable no-console */\n console.warn('Invalid selection state.', arguments, editorState.toJS());\n /*eslint-enable no-console */\n return selection;\n }\n }\n\n var anchorPath = DraftOffsetKey.decode(anchorKey);\n var anchorBlockKey = anchorPath.blockKey;\n var anchorLeaf = editorState.getBlockTree(anchorBlockKey).getIn([anchorPath.decoratorKey, 'leaves', anchorPath.leafKey]);\n\n var focusPath = DraftOffsetKey.decode(focusKey);\n var focusBlockKey = focusPath.blockKey;\n var focusLeaf = editorState.getBlockTree(focusBlockKey).getIn([focusPath.decoratorKey, 'leaves', focusPath.leafKey]);\n\n var anchorLeafStart = anchorLeaf.get('start');\n var focusLeafStart = focusLeaf.get('start');\n\n var anchorBlockOffset = anchorLeaf ? anchorLeafStart + anchorOffset : null;\n var focusBlockOffset = focusLeaf ? focusLeafStart + focusOffset : null;\n\n var areEqual = selection.getAnchorKey() === anchorBlockKey && selection.getAnchorOffset() === anchorBlockOffset && selection.getFocusKey() === focusBlockKey && selection.getFocusOffset() === focusBlockOffset;\n\n if (areEqual) {\n return selection;\n }\n\n var isBackward = false;\n if (anchorBlockKey === focusBlockKey) {\n var anchorLeafEnd = anchorLeaf.get('end');\n var focusLeafEnd = focusLeaf.get('end');\n if (focusLeafStart === anchorLeafStart && focusLeafEnd === anchorLeafEnd) {\n isBackward = focusOffset < anchorOffset;\n } else {\n isBackward = focusLeafStart < anchorLeafStart;\n }\n } else {\n var startKey = editorState.getCurrentContent().getBlockMap().keySeq().skipUntil(function (v) {\n return v === anchorBlockKey || v === focusBlockKey;\n }).first();\n isBackward = startKey === focusBlockKey;\n }\n\n return selection.merge({\n anchorKey: anchorBlockKey,\n anchorOffset: anchorBlockOffset,\n focusKey: focusBlockKey,\n focusOffset: focusBlockOffset,\n isBackward: isBackward\n });\n}\n\nmodule.exports = getUpdatedSelectionState;"},{"id":58,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getFragmentFromSelection.js","name":"./lib/getFragmentFromSelection.js","index":107,"index2":103,"size":714,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCopy.js","issuerId":122,"issuerName":"./lib/editOnCopy.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":122,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCopy.js","module":"./lib/editOnCopy.js","moduleName":"./lib/editOnCopy.js","type":"cjs require","userRequest":"./getFragmentFromSelection","loc":"15:31-68"},{"moduleId":123,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnCut.js","module":"./lib/editOnCut.js","moduleName":"./lib/editOnCut.js","type":"cjs require","userRequest":"./getFragmentFromSelection","loc":"19:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar getContentStateFragment = require('./getContentStateFragment');\n\nfunction getFragmentFromSelection(editorState) {\n var selectionState = editorState.getSelection();\n\n if (selectionState.isCollapsed()) {\n return null;\n }\n\n return getContentStateFragment(editorState.getCurrentContent(), selectionState);\n}\n\nmodule.exports = getFragmentFromSelection;"},{"id":59,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangeClientRects.js","name":"./lib/getRangeClientRects.js","index":119,"index2":113,"size":2166,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangeBoundingClientRect.js","issuerId":159,"issuerName":"./lib/getRangeBoundingClientRect.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":131,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/expandRangeToStartOfLine.js","module":"./lib/expandRangeToStartOfLine.js","moduleName":"./lib/expandRangeToStartOfLine.js","type":"cjs require","userRequest":"./getRangeClientRects","loc":"17:26-58"},{"moduleId":159,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangeBoundingClientRect.js","module":"./lib/getRangeBoundingClientRect.js","moduleName":"./lib/getRangeBoundingClientRect.js","type":"cjs require","userRequest":"./getRangeClientRects","loc":"15:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar isChrome = UserAgent.isBrowser('Chrome');\n\n// In Chrome, the client rects will include the entire bounds of all nodes that\n// begin (have a start tag) within the selection, even if the selection does\n// not overlap the entire node. To resolve this, we split the range at each\n// start tag and join the client rects together.\n// https://code.google.com/p/chromium/issues/detail?id=324437\n/* eslint-disable consistent-return */\nfunction getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}\n/* eslint-enable consistent-return */\n\n/**\n * Like range.getClientRects() but normalizes for browser bugs.\n */\nvar getRangeClientRects = isChrome ? getRangeClientRectsChrome : function (range) {\n return Array.from(range.getClientRects());\n};\n\nmodule.exports = getRangeClientRects;"},{"id":60,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelectionWithNodes.js","name":"./lib/getDraftEditorSelectionWithNodes.js","index":120,"index2":115,"size":7101,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","issuerId":130,"issuerName":"./lib/keyCommandBackspaceToStartOfLine.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":130,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceToStartOfLine.js","module":"./lib/keyCommandBackspaceToStartOfLine.js","moduleName":"./lib/keyCommandBackspaceToStartOfLine.js","type":"cjs require","userRequest":"./getDraftEditorSelectionWithNodes","loc":"18:39-84"},{"moduleId":147,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDraftEditorSelection.js","module":"./lib/getDraftEditorSelection.js","moduleName":"./lib/getDraftEditorSelection.js","type":"cjs require","userRequest":"./getDraftEditorSelectionWithNodes","loc":"15:39-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar findAncestorOffsetKey = require('./findAncestorOffsetKey');\nvar getSelectionOffsetKeyForNode = require('./getSelectionOffsetKeyForNode');\nvar getUpdatedSelectionState = require('./getUpdatedSelectionState');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Convert the current selection range to an anchor/focus pair of offset keys\n * and values that can be interpreted by components.\n */\nfunction getDraftEditorSelectionWithNodes(editorState, root, anchorNode, anchorOffset, focusNode, focusOffset) {\n var anchorIsTextNode = anchorNode.nodeType === Node.TEXT_NODE;\n var focusIsTextNode = focusNode.nodeType === Node.TEXT_NODE;\n\n // If the selection range lies only on text nodes, the task is simple.\n // Find the nearest offset-aware elements and use the\n // offset values supplied by the selection range.\n if (anchorIsTextNode && focusIsTextNode) {\n return {\n selectionState: getUpdatedSelectionState(editorState, nullthrows(findAncestorOffsetKey(anchorNode)), anchorOffset, nullthrows(findAncestorOffsetKey(focusNode)), focusOffset),\n needsRecovery: false\n };\n }\n\n var anchorPoint = null;\n var focusPoint = null;\n var needsRecovery = true;\n\n // An element is selected. Convert this selection range into leaf offset\n // keys and offset values for consumption at the component level. This\n // is common in Firefox, where select-all and triple click behavior leads\n // to entire elements being selected.\n //\n // Note that we use the `needsRecovery` parameter in the callback here. This\n // is because when certain elements are selected, the behavior for subsequent\n // cursor movement (e.g. via arrow keys) is uncertain and may not match\n // expectations at the component level. For example, if an entire
is\n // selected and the user presses the right arrow, Firefox keeps the selection\n // on the
. If we allow subsequent keypresses to insert characters\n // natively, they will be inserted into a browser-created text node to the\n // right of that
. This is obviously undesirable.\n //\n // With the `needsRecovery` flag, we inform the caller that it is responsible\n // for manually setting the selection state on the rendered document to\n // ensure proper selection state maintenance.\n\n if (anchorIsTextNode) {\n anchorPoint = {\n key: nullthrows(findAncestorOffsetKey(anchorNode)),\n offset: anchorOffset\n };\n focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);\n } else if (focusIsTextNode) {\n focusPoint = {\n key: nullthrows(findAncestorOffsetKey(focusNode)),\n offset: focusOffset\n };\n anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);\n } else {\n anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);\n focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);\n\n // If the selection is collapsed on an empty block, don't force recovery.\n // This way, on arrow key selection changes, the browser can move the\n // cursor from a non-zero offset on one block, through empty blocks,\n // to a matching non-zero offset on other text blocks.\n if (anchorNode === focusNode && anchorOffset === focusOffset) {\n needsRecovery = !!anchorNode.firstChild && anchorNode.firstChild.nodeName !== 'BR';\n }\n }\n\n return {\n selectionState: getUpdatedSelectionState(editorState, anchorPoint.key, anchorPoint.offset, focusPoint.key, focusPoint.offset),\n needsRecovery: needsRecovery\n };\n}\n\n/**\n * Identify the first leaf descendant for the given node.\n */\nfunction getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}\n\n/**\n * Identify the last leaf descendant for the given node.\n */\nfunction getLastLeaf(node) {\n while (node.lastChild && (\n // data-blocks has no offset\n node.lastChild instanceof Element && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n node = node.lastChild;\n }\n return node;\n}\n\nfunction getPointForNonTextNode(editorRoot, startNode, childOffset) {\n var node = startNode;\n var offsetKey = findAncestorOffsetKey(node);\n\n !(offsetKey != null || editorRoot && (editorRoot === node || editorRoot.firstChild === node)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown node in selection range.') : invariant(false) : void 0;\n\n // If the editorRoot is the selection, step downward into the content\n // wrapper.\n if (editorRoot === node) {\n node = node.firstChild;\n !(node instanceof Element && node.getAttribute('data-contents') === 'true') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid DraftEditorContents structure.') : invariant(false) : void 0;\n if (childOffset > 0) {\n childOffset = node.childNodes.length;\n }\n }\n\n // If the child offset is zero and we have an offset key, we're done.\n // If there's no offset key because the entire editor is selected,\n // find the leftmost (\"first\") leaf in the tree and use that as the offset\n // key.\n if (childOffset === 0) {\n var _key = null;\n if (offsetKey != null) {\n _key = offsetKey;\n } else {\n var firstLeaf = getFirstLeaf(node);\n _key = nullthrows(getSelectionOffsetKeyForNode(firstLeaf));\n }\n return { key: _key, offset: 0 };\n }\n\n var nodeBeforeCursor = node.childNodes[childOffset - 1];\n var leafKey = null;\n var textLength = null;\n\n if (!getSelectionOffsetKeyForNode(nodeBeforeCursor)) {\n // Our target node may be a leaf or a text node, in which case we're\n // already where we want to be and can just use the child's length as\n // our offset.\n leafKey = nullthrows(offsetKey);\n textLength = getTextContentLength(nodeBeforeCursor);\n } else {\n // Otherwise, we'll look at the child to the left of the cursor and find\n // the last leaf node in its subtree.\n var lastLeaf = getLastLeaf(nodeBeforeCursor);\n leafKey = nullthrows(getSelectionOffsetKeyForNode(lastLeaf));\n textLength = getTextContentLength(lastLeaf);\n }\n\n return {\n key: leafKey,\n offset: textLength\n };\n}\n\n/**\n * Return the length of a node's textContent, regarding single newline\n * characters as zero-length. This allows us to avoid problems with identifying\n * the correct selection offset for empty blocks in IE, in which we\n * render newlines instead of break tags.\n */\nfunction getTextContentLength(node) {\n var textContent = node.textContent;\n return textContent === '\\n' ? 0 : textContent.length;\n}\n\nmodule.exports = getDraftEditorSelectionWithNodes;"},{"id":61,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftRemovableWord.js","name":"./lib/DraftRemovableWord.js","index":124,"index2":120,"size":1849,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceWord.js","issuerId":132,"issuerName":"./lib/keyCommandBackspaceWord.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":132,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandBackspaceWord.js","module":"./lib/keyCommandBackspaceWord.js","moduleName":"./lib/keyCommandBackspaceWord.js","type":"cjs require","userRequest":"./DraftRemovableWord","loc":"15:25-56"},{"moduleId":134,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandDeleteWord.js","module":"./lib/keyCommandDeleteWord.js","moduleName":"./lib/keyCommandDeleteWord.js","type":"cjs require","userRequest":"./DraftRemovableWord","loc":"15:25-56"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar TokenizeUtil = require('fbjs/lib/TokenizeUtil');\n\nvar punctuation = TokenizeUtil.getPunctuation();\n\n// The apostrophe and curly single quotes behave in a curious way: when\n// surrounded on both sides by word characters, they behave as word chars; when\n// either neighbor is punctuation or an end of the string, they behave as\n// punctuation.\nvar CHAMELEON_CHARS = '[\\'\\u2018\\u2019]';\n\n// Remove the underscore, which should count as part of the removable word. The\n// \"chameleon chars\" also count as punctuation in this regex.\nvar WHITESPACE_AND_PUNCTUATION = '\\\\s|(?![_])' + punctuation;\n\nvar DELETE_STRING = '^' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)';\nvar DELETE_REGEX = new RegExp(DELETE_STRING);\n\nvar BACKSPACE_STRING = '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '$';\nvar BACKSPACE_REGEX = new RegExp(BACKSPACE_STRING);\n\nfunction getRemovableWord(text, isBackward) {\n var matches = isBackward ? BACKSPACE_REGEX.exec(text) : DELETE_REGEX.exec(text);\n return matches ? matches[0] : text;\n}\n\nvar DraftRemovableWord = {\n getBackward: function getBackward(text) {\n return getRemovableWord(text, true);\n },\n\n getForward: function getForward(text) {\n return getRemovableWord(text, false);\n }\n};\n\nmodule.exports = DraftRemovableWord;"},{"id":62,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveSelectionForward.js","name":"./lib/moveSelectionForward.js","index":127,"index2":122,"size":1298,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandDeleteWord.js","issuerId":134,"issuerName":"./lib/keyCommandDeleteWord.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":134,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandDeleteWord.js","module":"./lib/keyCommandDeleteWord.js","moduleName":"./lib/keyCommandDeleteWord.js","type":"cjs require","userRequest":"./moveSelectionForward","loc":"18:27-60"},{"moduleId":139,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/keyCommandPlainDelete.js","module":"./lib/keyCommandPlainDelete.js","moduleName":"./lib/keyCommandPlainDelete.js","type":"cjs require","userRequest":"./moveSelectionForward","loc":"18:27-60"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\n/**\n * Given a collapsed selection, move the focus `maxDistance` forward within\n * the selected block. If the selection will go beyond the end of the block,\n * move focus to the start of the next block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\nfunction moveSelectionForward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n var content = editorState.getCurrentContent();\n\n var focusKey = key;\n var focusOffset = void 0;\n\n var block = content.getBlockForKey(key);\n\n if (maxDistance > block.getText().length - offset) {\n focusKey = content.getKeyAfter(key);\n focusOffset = 0;\n } else {\n focusOffset = offset + maxDistance;\n }\n\n return selection.merge({ focusKey: focusKey, focusOffset: focusOffset });\n}\n\nmodule.exports = moveSelectionForward;"},{"id":63,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","name":"./lib/convertFromHTMLToContentBlocks.js","index":137,"index2":134,"size":21171,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./convertFromHTMLToContentBlocks","loc":"40:109-152"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./convertFromHTMLToContentBlocks","loc":"24:44-87"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _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; };\n\nvar _knownListItemDepthCl,\n _assign = require('object-assign');\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DraftEntity = require('./DraftEntity');\nvar Immutable = require('immutable');\n\nvar _require = require('immutable'),\n Set = _require.Set;\n\nvar URI = require('fbjs/lib/URI');\n\nvar cx = require('fbjs/lib/cx');\nvar generateRandomKey = require('./generateRandomKey');\nvar getSafeBodyFromHTML = require('./getSafeBodyFromHTML');\nvar gkx = require('./gkx');\nvar invariant = require('fbjs/lib/invariant');\nvar sanitizeDraftText = require('./sanitizeDraftText');\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\n\nvar List = Immutable.List,\n OrderedSet = Immutable.OrderedSet;\n\n\nvar NBSP = ' ';\nvar SPACE = ' ';\n\n// Arbitrary max indent\nvar MAX_DEPTH = 4;\n\n// used for replacing characters in HTML\nvar REGEX_CR = new RegExp('\\r', 'g');\nvar REGEX_LF = new RegExp('\\n', 'g');\nvar REGEX_NBSP = new RegExp(NBSP, 'g');\nvar REGEX_CARRIAGE = new RegExp(' ?', 'g');\nvar REGEX_ZWS = new RegExp('​?', 'g');\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight\nvar boldValues = ['bold', 'bolder', '500', '600', '700', '800', '900'];\nvar notBoldValues = ['light', 'lighter', '100', '200', '300', '400'];\n\n// Block tag flow is different because LIs do not have\n// a deterministic style ;_;\nvar inlineTags = {\n b: 'BOLD',\n code: 'CODE',\n del: 'STRIKETHROUGH',\n em: 'ITALIC',\n i: 'ITALIC',\n s: 'STRIKETHROUGH',\n strike: 'STRIKETHROUGH',\n strong: 'BOLD',\n u: 'UNDERLINE'\n};\n\nvar knownListItemDepthClasses = (_knownListItemDepthCl = {}, _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth0'), 0), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth1'), 1), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth2'), 2), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth3'), 3), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth4'), 4), _knownListItemDepthCl);\n\nvar anchorAttr = ['className', 'href', 'rel', 'target', 'title'];\n\nvar imgAttr = ['alt', 'className', 'height', 'src', 'width'];\n\nvar lastBlock = void 0;\n\nvar EMPTY_CHUNK = {\n text: '',\n inlines: [],\n entities: [],\n blocks: []\n};\n\nvar EMPTY_BLOCK = {\n children: List(),\n depth: 0,\n key: '',\n type: ''\n};\n\nvar getListBlockType = function getListBlockType(tag, lastList) {\n if (tag === 'li') {\n return lastList === 'ol' ? 'ordered-list-item' : 'unordered-list-item';\n }\n return null;\n};\n\nvar getBlockMapSupportedTags = function getBlockMapSupportedTags(blockRenderMap) {\n var unstyledElement = blockRenderMap.get('unstyled').element;\n var tags = Set([]);\n\n blockRenderMap.forEach(function (draftBlock) {\n if (draftBlock.aliasedElements) {\n draftBlock.aliasedElements.forEach(function (tag) {\n tags = tags.add(tag);\n });\n }\n\n tags = tags.add(draftBlock.element);\n });\n\n return tags.filter(function (tag) {\n return tag && tag !== unstyledElement;\n }).toArray().sort();\n};\n\n// custom element conversions\nvar getMultiMatchedType = function getMultiMatchedType(tag, lastList, multiMatchExtractor) {\n for (var ii = 0; ii < multiMatchExtractor.length; ii++) {\n var matchType = multiMatchExtractor[ii](tag, lastList);\n if (matchType) {\n return matchType;\n }\n }\n return null;\n};\n\nvar getBlockTypeForTag = function getBlockTypeForTag(tag, lastList, blockRenderMap) {\n var matchedTypes = blockRenderMap.filter(function (draftBlock) {\n return draftBlock.element === tag || draftBlock.wrapper === tag || draftBlock.aliasedElements && draftBlock.aliasedElements.some(function (alias) {\n return alias === tag;\n });\n }).keySeq().toSet().toArray().sort();\n\n // if we dont have any matched type, return unstyled\n // if we have one matched type return it\n // if we have multi matched types use the multi-match function to gather type\n switch (matchedTypes.length) {\n case 0:\n return 'unstyled';\n case 1:\n return matchedTypes[0];\n default:\n return getMultiMatchedType(tag, lastList, [getListBlockType]) || 'unstyled';\n }\n};\n\nvar processInlineTag = function processInlineTag(tag, node, currentStyle) {\n var styleToCheck = inlineTags[tag];\n if (styleToCheck) {\n currentStyle = currentStyle.add(styleToCheck).toOrderedSet();\n } else if (node instanceof HTMLElement) {\n var htmlElement = node;\n currentStyle = currentStyle.withMutations(function (style) {\n var fontWeight = htmlElement.style.fontWeight;\n var fontStyle = htmlElement.style.fontStyle;\n var textDecoration = htmlElement.style.textDecoration;\n\n if (boldValues.indexOf(fontWeight) >= 0) {\n style.add('BOLD');\n } else if (notBoldValues.indexOf(fontWeight) >= 0) {\n style.remove('BOLD');\n }\n\n if (fontStyle === 'italic') {\n style.add('ITALIC');\n } else if (fontStyle === 'normal') {\n style.remove('ITALIC');\n }\n\n if (textDecoration === 'underline') {\n style.add('UNDERLINE');\n }\n if (textDecoration === 'line-through') {\n style.add('STRIKETHROUGH');\n }\n if (textDecoration === 'none') {\n style.remove('UNDERLINE');\n style.remove('STRIKETHROUGH');\n }\n }).toOrderedSet();\n }\n return currentStyle;\n};\n\nvar joinChunks = function joinChunks(A, B, experimentalHasNestedBlocks) {\n // Sometimes two blocks will touch in the DOM and we need to strip the\n // extra delimiter to preserve niceness.\n var lastInA = A.text.slice(-1);\n var firstInB = B.text.slice(0, 1);\n\n if (lastInA === '\\r' && firstInB === '\\r' && !experimentalHasNestedBlocks) {\n A.text = A.text.slice(0, -1);\n A.inlines.pop();\n A.entities.pop();\n A.blocks.pop();\n }\n\n // Kill whitespace after blocks\n if (lastInA === '\\r') {\n if (B.text === SPACE || B.text === '\\n') {\n return A;\n } else if (firstInB === SPACE || firstInB === '\\n') {\n B.text = B.text.slice(1);\n B.inlines.shift();\n B.entities.shift();\n }\n }\n\n return {\n text: A.text + B.text,\n inlines: A.inlines.concat(B.inlines),\n entities: A.entities.concat(B.entities),\n blocks: A.blocks.concat(B.blocks)\n };\n};\n\n/**\n * Check to see if we have anything like

... to create\n * block tags from. If we do, we can use those and ignore
tags. If we\n * don't, we can treat
tags as meaningful (unstyled) blocks.\n */\nvar containsSemanticBlockMarkup = function containsSemanticBlockMarkup(html, blockTags) {\n return blockTags.some(function (tag) {\n return html.indexOf('<' + tag) !== -1;\n });\n};\n\nvar hasValidLinkText = function hasValidLinkText(link) {\n !(link instanceof HTMLAnchorElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Link must be an HTMLAnchorElement.') : invariant(false) : void 0;\n var protocol = link.protocol;\n return protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:';\n};\n\nvar getWhitespaceChunk = function getWhitespaceChunk(inEntity) {\n var entities = new Array(1);\n if (inEntity) {\n entities[0] = inEntity;\n }\n return _extends({}, EMPTY_CHUNK, {\n text: SPACE,\n inlines: [OrderedSet()],\n entities: entities\n });\n};\n\nvar getSoftNewlineChunk = function getSoftNewlineChunk() {\n return _extends({}, EMPTY_CHUNK, {\n text: '\\n',\n inlines: [OrderedSet()],\n entities: new Array(1)\n });\n};\n\nvar getChunkedBlock = function getChunkedBlock() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return _extends({}, EMPTY_BLOCK, props);\n};\n\nvar getBlockDividerChunk = function getBlockDividerChunk(block, depth) {\n var parentKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n return {\n text: '\\r',\n inlines: [OrderedSet()],\n entities: new Array(1),\n blocks: [getChunkedBlock({\n parent: parentKey,\n key: generateRandomKey(),\n type: block,\n depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n })]\n };\n};\n\n/**\n * If we're pasting from one DraftEditor to another we can check to see if\n * existing list item depth classes are being used and preserve this style\n */\nvar getListItemDepth = function getListItemDepth(node) {\n var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n Object.keys(knownListItemDepthClasses).some(function (depthClass) {\n if (node.classList.contains(depthClass)) {\n depth = knownListItemDepthClasses[depthClass];\n }\n });\n return depth;\n};\n\nvar genFragment = function genFragment(entityMap, node, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, inEntity, parentKey) {\n var lastLastBlock = lastBlock;\n var nodeName = node.nodeName.toLowerCase();\n var newEntityMap = entityMap;\n var nextBlockType = 'unstyled';\n var newBlock = false;\n var inBlockType = inBlock && getBlockTypeForTag(inBlock, lastList, blockRenderMap);\n var chunk = _extends({}, EMPTY_CHUNK);\n var newChunk = null;\n var blockKey = void 0;\n\n // Base Case\n if (nodeName === '#text') {\n var _text = node.textContent;\n var nodeTextContent = _text.trim();\n\n // We should not create blocks for leading spaces that are\n // existing around ol/ul and their children list items\n if (lastList && nodeTextContent === '' && node.parentElement) {\n var parentNodeName = node.parentElement.nodeName.toLowerCase();\n if (parentNodeName === 'ol' || parentNodeName === 'ul') {\n return { chunk: _extends({}, EMPTY_CHUNK), entityMap: entityMap };\n }\n }\n\n if (nodeTextContent === '' && inBlock !== 'pre') {\n return { chunk: getWhitespaceChunk(inEntity), entityMap: entityMap };\n }\n if (inBlock !== 'pre') {\n // Can't use empty string because MSWord\n _text = _text.replace(REGEX_LF, SPACE);\n }\n\n // save the last block so we can use it later\n lastBlock = nodeName;\n\n return {\n chunk: {\n text: _text,\n inlines: Array(_text.length).fill(inlineStyle),\n entities: Array(_text.length).fill(inEntity),\n blocks: []\n },\n entityMap: entityMap\n };\n }\n\n // save the last block so we can use it later\n lastBlock = nodeName;\n\n // BR tags\n if (nodeName === 'br') {\n if (lastLastBlock === 'br' && (!inBlock || inBlockType === 'unstyled')) {\n return {\n chunk: getBlockDividerChunk('unstyled', depth, parentKey),\n entityMap: entityMap\n };\n }\n return { chunk: getSoftNewlineChunk(), entityMap: entityMap };\n }\n\n // IMG tags\n if (nodeName === 'img' && node instanceof HTMLImageElement && node.attributes.getNamedItem('src') && node.attributes.getNamedItem('src').value) {\n var image = node;\n var entityConfig = {};\n\n imgAttr.forEach(function (attr) {\n var imageAttribute = image.getAttribute(attr);\n if (imageAttribute) {\n entityConfig[attr] = imageAttribute;\n }\n });\n // Forcing this node to have children because otherwise no entity will be\n // created for this node.\n // The child text node cannot just have a space or return as content -\n // we strip those out.\n // See https://github.com/facebook/draft-js/issues/231 for some context.\n node.textContent = '\\uD83D\\uDCF7';\n\n // TODO: update this when we remove DraftEntity entirely\n inEntity = DraftEntity.__create('IMAGE', 'MUTABLE', entityConfig || {});\n }\n\n // Inline tags\n inlineStyle = processInlineTag(nodeName, node, inlineStyle);\n\n // Handle lists\n if (nodeName === 'ul' || nodeName === 'ol') {\n if (lastList) {\n depth += 1;\n }\n lastList = nodeName;\n }\n\n if (!experimentalTreeDataSupport && nodeName === 'li' && node instanceof HTMLElement) {\n depth = getListItemDepth(node, depth);\n }\n\n var blockType = getBlockTypeForTag(nodeName, lastList, blockRenderMap);\n var inListBlock = lastList && inBlock === 'li' && nodeName === 'li';\n var inBlockOrHasNestedBlocks = (!inBlock || experimentalTreeDataSupport) && blockTags.indexOf(nodeName) !== -1;\n\n // Block Tags\n if (inListBlock || inBlockOrHasNestedBlocks) {\n chunk = getBlockDividerChunk(blockType, depth, parentKey);\n blockKey = chunk.blocks[0].key;\n inBlock = nodeName;\n newBlock = !experimentalTreeDataSupport;\n }\n\n // this is required so that we can handle 'ul' and 'ol'\n if (inListBlock) {\n nextBlockType = lastList === 'ul' ? 'unordered-list-item' : 'ordered-list-item';\n }\n\n // Recurse through children\n var child = node.firstChild;\n if (child != null) {\n nodeName = child.nodeName.toLowerCase();\n }\n\n var entityId = null;\n\n while (child) {\n if (child instanceof HTMLAnchorElement && child.href && hasValidLinkText(child)) {\n (function () {\n var anchor = child;\n var entityConfig = {};\n\n anchorAttr.forEach(function (attr) {\n var anchorAttribute = anchor.getAttribute(attr);\n if (anchorAttribute) {\n entityConfig[attr] = anchorAttribute;\n }\n });\n\n entityConfig.url = new URI(anchor.href).toString();\n // TODO: update this when we remove DraftEntity completely\n entityId = DraftEntity.__create('LINK', 'MUTABLE', entityConfig || {});\n })();\n } else {\n entityId = undefined;\n }\n\n var _genFragment = genFragment(newEntityMap, child, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, entityId || inEntity, experimentalTreeDataSupport ? blockKey : null),\n generatedChunk = _genFragment.chunk,\n maybeUpdatedEntityMap = _genFragment.entityMap;\n\n newChunk = generatedChunk;\n newEntityMap = maybeUpdatedEntityMap;\n\n chunk = joinChunks(chunk, newChunk, experimentalTreeDataSupport);\n var sibling = child.nextSibling;\n\n // Put in a newline to break up blocks inside blocks\n if (!parentKey && sibling && blockTags.indexOf(nodeName) >= 0 && inBlock) {\n chunk = joinChunks(chunk, getSoftNewlineChunk());\n }\n if (sibling) {\n nodeName = sibling.nodeName.toLowerCase();\n }\n child = sibling;\n }\n\n if (newBlock) {\n chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth, parentKey));\n }\n\n return { chunk: chunk, entityMap: newEntityMap };\n};\n\nvar getChunkForHTML = function getChunkForHTML(html, DOMBuilder, blockRenderMap, entityMap) {\n html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE).replace(REGEX_CARRIAGE, '').replace(REGEX_ZWS, '');\n\n var supportedBlockTags = getBlockMapSupportedTags(blockRenderMap);\n\n var safeBody = DOMBuilder(html);\n if (!safeBody) {\n return null;\n }\n lastBlock = null;\n\n // Sometimes we aren't dealing with content that contains nice semantic\n // tags. In this case, use divs to separate everything out into paragraphs\n // and hope for the best.\n var workingBlocks = containsSemanticBlockMarkup(html, supportedBlockTags) ? supportedBlockTags : ['div'];\n\n // Start with -1 block depth to offset the fact that we are passing in a fake\n // UL block to start with.\n var fragment = genFragment(entityMap, safeBody, OrderedSet(), 'ul', null, workingBlocks, -1, blockRenderMap);\n\n var chunk = fragment.chunk;\n var newEntityMap = fragment.entityMap;\n\n // join with previous block to prevent weirdness on paste\n if (chunk.text.indexOf('\\r') === 0) {\n chunk = {\n text: chunk.text.slice(1),\n inlines: chunk.inlines.slice(1),\n entities: chunk.entities.slice(1),\n blocks: chunk.blocks\n };\n }\n\n // Kill block delimiter at the end\n if (chunk.text.slice(-1) === '\\r') {\n chunk.text = chunk.text.slice(0, -1);\n chunk.inlines = chunk.inlines.slice(0, -1);\n chunk.entities = chunk.entities.slice(0, -1);\n chunk.blocks.pop();\n }\n\n // If we saw no block tags, put an unstyled one in\n if (chunk.blocks.length === 0) {\n chunk.blocks.push(_extends({}, EMPTY_CHUNK, {\n type: 'unstyled',\n depth: 0\n }));\n }\n\n // Sometimes we start with text that isn't in a block, which is then\n // followed by blocks. Need to fix up the blocks to add in\n // an unstyled block for this content\n if (chunk.text.split('\\r').length === chunk.blocks.length + 1) {\n chunk.blocks.unshift({ type: 'unstyled', depth: 0 });\n }\n\n return { chunk: chunk, entityMap: newEntityMap };\n};\n\nvar convertChunkToContentBlocks = function convertChunkToContentBlocks(chunk) {\n if (!chunk || !chunk.text || !Array.isArray(chunk.blocks)) {\n return null;\n }\n\n var initialState = {\n cacheRef: {},\n contentBlocks: []\n };\n\n var start = 0;\n\n var rawBlocks = chunk.blocks,\n rawInlines = chunk.inlines,\n rawEntities = chunk.entities;\n\n\n var BlockNodeRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\n return chunk.text.split('\\r').reduce(function (acc, textBlock, index) {\n // Make absolutely certain that our text is acceptable.\n textBlock = sanitizeDraftText(textBlock);\n\n var block = rawBlocks[index];\n var end = start + textBlock.length;\n var inlines = rawInlines.slice(start, end);\n var entities = rawEntities.slice(start, end);\n var characterList = List(inlines.map(function (style, index) {\n var data = { style: style, entity: null };\n if (entities[index]) {\n data.entity = entities[index];\n }\n return CharacterMetadata.create(data);\n }));\n start = end + 1;\n\n var depth = block.depth,\n type = block.type,\n parent = block.parent;\n\n\n var key = block.key || generateRandomKey();\n var parentTextNodeKey = null; // will be used to store container text nodes\n\n // childrens add themselves to their parents since we are iterating in order\n if (parent) {\n var parentIndex = acc.cacheRef[parent];\n var parentRecord = acc.contentBlocks[parentIndex];\n\n // if parent has text we need to split it into a separate unstyled element\n if (parentRecord.getChildKeys().isEmpty() && parentRecord.getText()) {\n var parentCharacterList = parentRecord.getCharacterList();\n var parentText = parentRecord.getText();\n parentTextNodeKey = generateRandomKey();\n\n var textNode = new ContentBlockNode({\n key: parentTextNodeKey,\n text: parentText,\n characterList: parentCharacterList,\n parent: parent,\n nextSibling: key\n });\n\n acc.contentBlocks.push(textNode);\n\n parentRecord = parentRecord.withMutations(function (block) {\n block.set('characterList', List()).set('text', '').set('children', parentRecord.children.push(textNode.getKey()));\n });\n }\n\n acc.contentBlocks[parentIndex] = parentRecord.set('children', parentRecord.children.push(key));\n }\n\n var blockNode = new BlockNodeRecord({\n key: key,\n parent: parent,\n type: type,\n depth: depth,\n text: textBlock,\n characterList: characterList,\n prevSibling: parentTextNodeKey || (index === 0 || rawBlocks[index - 1].parent !== parent ? null : rawBlocks[index - 1].key),\n nextSibling: index === rawBlocks.length - 1 || rawBlocks[index + 1].parent !== parent ? null : rawBlocks[index + 1].key\n });\n\n // insert node\n acc.contentBlocks.push(blockNode);\n\n // cache ref for building links\n acc.cacheRef[blockNode.key] = index;\n\n return acc;\n }, initialState).contentBlocks;\n};\n\nvar convertFromHTMLtoContentBlocks = function convertFromHTMLtoContentBlocks(html) {\n var DOMBuilder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getSafeBodyFromHTML;\n var blockRenderMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DefaultDraftBlockRenderMap;\n\n // Be ABSOLUTELY SURE that the dom builder you pass here won't execute\n // arbitrary code in whatever environment you're running this in. For an\n // example of how we try to do this in-browser, see getSafeBodyFromHTML.\n\n // TODO: replace DraftEntity with an OrderedMap here\n var chunkData = getChunkForHTML(html, DOMBuilder, blockRenderMap, DraftEntity);\n\n if (chunkData == null) {\n return null;\n }\n\n var chunk = chunkData.chunk,\n entityMap = chunkData.entityMap;\n\n var contentBlocks = convertChunkToContentBlocks(chunk);\n\n return {\n contentBlocks: contentBlocks,\n entityMap: entityMap\n };\n};\n\nmodule.exports = convertFromHTMLtoContentBlocks;"},{"id":64,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/URI.js","name":"./node_modules/fbjs/lib/URI.js","index":138,"index2":132,"size":584,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","issuerId":65,"issuerName":"./lib/convertFromHTMLToContentBlocks2.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":63,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks.js","module":"./lib/convertFromHTMLToContentBlocks.js","moduleName":"./lib/convertFromHTMLToContentBlocks.js","type":"cjs require","userRequest":"fbjs/lib/URI","loc":"32:10-33"},{"moduleId":65,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","module":"./lib/convertFromHTMLToContentBlocks2.js","moduleName":"./lib/convertFromHTMLToContentBlocks2.js","type":"cjs require","userRequest":"fbjs/lib/URI","loc":"35:10-33"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar URI = function () {\n function URI(uri) {\n _classCallCheck(this, URI);\n\n this._uri = uri;\n }\n\n URI.prototype.toString = function toString() {\n return this._uri;\n };\n\n return URI;\n}();\n\nmodule.exports = URI;"},{"id":65,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromHTMLToContentBlocks2.js","name":"./lib/convertFromHTMLToContentBlocks2.js","index":140,"index2":135,"size":23141,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./convertFromHTMLToContentBlocks2","loc":"40:62-106"},{"moduleId":143,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftPasteProcessor.js","module":"./lib/DraftPasteProcessor.js","moduleName":"./lib/DraftPasteProcessor.js","type":"cjs require","userRequest":"./convertFromHTMLToContentBlocks2","loc":"25:40-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _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; };\n\nvar _knownListItemDepthCl,\n _assign = require('object-assign');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DraftEntity = require('./DraftEntity');\n\nvar _require = require('immutable'),\n List = _require.List,\n Map = _require.Map,\n OrderedSet = _require.OrderedSet;\n\nvar URI = require('fbjs/lib/URI');\n\nvar cx = require('fbjs/lib/cx');\nvar generateRandomKey = require('./generateRandomKey');\nvar getSafeBodyFromHTML = require('./getSafeBodyFromHTML');\nvar gkx = require('./gkx');\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\n\nvar NBSP = ' ';\nvar SPACE = ' ';\n\n// used for replacing characters in HTML\nvar REGEX_CR = new RegExp('\\r', 'g');\nvar REGEX_LF = new RegExp('\\n', 'g');\nvar REGEX_NBSP = new RegExp(NBSP, 'g');\nvar REGEX_CARRIAGE = new RegExp(' ?', 'g');\nvar REGEX_ZWS = new RegExp('​?', 'g');\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight\nvar boldValues = ['bold', 'bolder', '500', '600', '700', '800', '900'];\nvar notBoldValues = ['light', 'lighter', '100', '200', '300', '400'];\n\nvar anchorAttr = ['className', 'href', 'rel', 'target', 'title'];\nvar imgAttr = ['alt', 'className', 'height', 'src', 'width'];\n\nvar knownListItemDepthClasses = (_knownListItemDepthCl = {}, _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth0'), 0), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth1'), 1), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth2'), 2), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth3'), 3), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth4'), 4), _knownListItemDepthCl);\n\nvar HTMLTagToInlineStyleMap = Map({\n b: 'BOLD',\n code: 'CODE',\n del: 'STRIKETHROUGH',\n em: 'ITALIC',\n i: 'ITALIC',\n s: 'STRIKETHROUGH',\n strike: 'STRIKETHROUGH',\n strong: 'BOLD',\n u: 'UNDERLINE'\n});\n\n/**\n * Build a mapping from HTML tags to draftjs block types\n * out of a BlockRenderMap.\n *\n * The BlockTypeMap for the default BlockRenderMap looks like this:\n * Map({\n * h1: 'header-one',\n * h2: 'header-two',\n * h3: 'header-three',\n * h4: 'header-four',\n * h5: 'header-five',\n * h6: 'header-six',\n * blockquote: 'blockquote',\n * figure: 'atomic',\n * pre: ['code-block'],\n * div: 'unstyled',\n * p: 'unstyled',\n * li: ['ordered-list-item', 'unordered-list-item'],\n * })\n */\nvar buildBlockTypeMap = function buildBlockTypeMap(blockRenderMap) {\n var blockTypeMap = {};\n\n blockRenderMap.mapKeys(function (blockType, desc) {\n var elements = [desc.element];\n if (desc.aliasedElements !== undefined) {\n elements.push.apply(elements, desc.aliasedElements);\n }\n elements.forEach(function (element) {\n if (blockTypeMap[element] === undefined) {\n blockTypeMap[element] = blockType;\n } else if (typeof blockTypeMap[element] === 'string') {\n blockTypeMap[element] = [blockTypeMap[element], blockType];\n } else {\n blockTypeMap[element].push(blockType);\n }\n });\n });\n\n return Map(blockTypeMap);\n};\n\n/**\n * If we're pasting from one DraftEditor to another we can check to see if\n * existing list item depth classes are being used and preserve this style\n */\nvar getListItemDepth = function getListItemDepth(node) {\n var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n Object.keys(knownListItemDepthClasses).some(function (depthClass) {\n if (node.classList.contains(depthClass)) {\n depth = knownListItemDepthClasses[depthClass];\n }\n });\n return depth;\n};\n\n/**\n * Return true if the provided HTML Element can be used to build a\n * Draftjs-compatible link.\n */\nvar isValidAnchor = function isValidAnchor(node) {\n return !!(node instanceof HTMLAnchorElement && node.href && (node.protocol === 'http:' || node.protocol === 'https:' || node.protocol === 'mailto:'));\n};\n\n/**\n * Return true if the provided HTML Element can be used to build a\n * Draftjs-compatible image.\n */\nvar isValidImage = function isValidImage(node) {\n return !!(node instanceof HTMLImageElement && node.attributes.getNamedItem('src') && node.attributes.getNamedItem('src').value);\n};\n\n/**\n * Determine if a nodeName is a list type, 'ul' or 'ol'\n */\nvar isListNode = function isListNode(nodeName) {\n return nodeName === 'ul' || nodeName === 'ol';\n};\n\n/**\n * ContentBlockConfig is a mutable data structure that holds all\n * the information required to build a ContentBlock and an array of\n * all the child nodes (childConfigs).\n * It is being used a temporary data structure by the\n * ContentBlocksBuilder class.\n */\n\n/**\n * ContentBlocksBuilder builds a list of ContentBlocks and an Entity Map\n * out of one (or several) HTMLElement(s).\n *\n * The algorithm has two passes: first it builds a tree of ContentBlockConfigs\n * by walking through the HTML nodes and their children, then it walks the\n * ContentBlockConfigs tree to compute parents/siblings and create\n * the actual ContentBlocks.\n *\n * Typical usage is:\n * new ContentBlocksBuilder()\n * .addDOMNode(someHTMLNode)\n * .addDOMNode(someOtherHTMLNode)\n * .getContentBlocks();\n *\n */\nvar ContentBlocksBuilder = function () {\n\n // Map HTML tags to draftjs block types and disambiguation function\n\n\n // The content blocks generated from the blockConfigs\n\n // Most of the method in the class depend on the state of the content builder\n // (i.e. currentBlockType, currentDepth, currentEntity etc.). Though it may\n // be confusing at first, it made the code simpler than the alternative which\n // is to pass those values around in every call.\n\n // The following attributes are used to accumulate text and styles\n // as we are walking the HTML node tree.\n function ContentBlocksBuilder(blockTypeMap, disambiguate) {\n _classCallCheck(this, ContentBlocksBuilder);\n\n this.clear();\n this.blockTypeMap = blockTypeMap;\n this.disambiguate = disambiguate;\n }\n\n /**\n * Clear the internal state of the ContentBlocksBuilder\n */\n\n\n // Entity map use to store links and images found in the HTML nodes\n\n\n // Describes the future ContentState as a tree of content blocks\n\n\n ContentBlocksBuilder.prototype.clear = function clear() {\n this.characterList = List();\n this.blockConfigs = [];\n this.currentBlockType = 'unstyled';\n this.currentDepth = -1;\n this.currentEntity = null;\n this.currentStyle = OrderedSet();\n this.currentText = '';\n this.entityMap = DraftEntity;\n this.wrapper = 'ul';\n this.contentBlocks = [];\n };\n\n /**\n * Add an HTMLElement to the ContentBlocksBuilder\n */\n\n\n ContentBlocksBuilder.prototype.addDOMNode = function addDOMNode(node) {\n var _blockConfigs;\n\n this.contentBlocks = [];\n // Converts the HTML node to block config\n (_blockConfigs = this.blockConfigs).push.apply(_blockConfigs, this._toBlockConfigs([node]));\n\n // There might be some left over text in the builder's\n // internal state, if so make a ContentBlock out of it.\n this._trimCurrentText();\n if (this.currentText !== '') {\n this.blockConfigs.push(this._makeBlockConfig());\n }\n\n // for chaining\n return this;\n };\n\n /**\n * Return the ContentBlocks and the EntityMap that corresponds\n * to the previously added HTML nodes.\n */\n\n\n ContentBlocksBuilder.prototype.getContentBlocks = function getContentBlocks() {\n if (this.contentBlocks.length === 0) {\n if (experimentalTreeDataSupport) {\n this._toContentBlocks(this.blockConfigs);\n } else {\n this._toFlatContentBlocks(this.blockConfigs);\n }\n }\n return {\n contentBlocks: this.contentBlocks,\n entityMap: this.entityMap\n };\n };\n\n /**\n * Add a new inline style to the upcoming nodes.\n */\n\n\n ContentBlocksBuilder.prototype.addStyle = function addStyle(inlineStyle) {\n this.currentStyle = this.currentStyle.add(inlineStyle);\n };\n\n /**\n * Remove a currently applied inline style.\n */\n\n\n ContentBlocksBuilder.prototype.removeStyle = function removeStyle(inlineStyle) {\n this.currentStyle = this.currentStyle.remove(inlineStyle);\n };\n\n // ***********************************WARNING******************************\n // The methods below this line are private - don't call them directly.\n\n /**\n * Generate a new ContentBlockConfig out of the current internal state\n * of the builder, then clears the internal state.\n */\n\n\n ContentBlocksBuilder.prototype._makeBlockConfig = function _makeBlockConfig() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var key = config.key || generateRandomKey();\n var block = _extends({\n key: key,\n type: this.currentBlockType,\n text: this.currentText,\n characterList: this.characterList,\n depth: Math.max(0, this.currentDepth),\n parent: null,\n children: List(),\n prevSibling: null,\n nextSibling: null,\n childConfigs: []\n }, config);\n this.characterList = List();\n this.currentBlockType = 'unstyled';\n this.currentDepth = -1;\n this.currentText = '';\n return block;\n };\n\n /**\n * Converts an array of HTML elements to a multi-root tree of content\n * block configs. Some text content may be left in the builders internal\n * state to enable chaining sucessive calls.\n */\n\n\n ContentBlocksBuilder.prototype._toBlockConfigs = function _toBlockConfigs(nodes) {\n var blockConfigs = [];\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'body' || isListNode(nodeName)) {\n // body, ol and ul are 'block' type nodes so create a block config\n // with the text accumulated so far (if any)\n this._trimCurrentText();\n if (this.currentText !== '') {\n blockConfigs.push(this._makeBlockConfig());\n }\n\n // body, ol and ul nodes are ignored, but their children are inlined in\n // the parent block config.\n var wasCurrentDepth = this.currentDepth;\n var wasWrapper = this.wrapper;\n if (isListNode(nodeName)) {\n this.wrapper = nodeName;\n if (isListNode(wasWrapper)) {\n this.currentDepth++;\n }\n }\n blockConfigs.push.apply(blockConfigs, this._toBlockConfigs(Array.from(node.childNodes)));\n this.currentDepth = wasCurrentDepth;\n this.wrapper = wasWrapper;\n continue;\n }\n\n var blockType = this.blockTypeMap.get(nodeName);\n if (blockType !== undefined) {\n // 'block' type node means we need to create a block config\n // with the text accumulated so far (if any)\n this._trimCurrentText();\n if (this.currentText !== '') {\n blockConfigs.push(this._makeBlockConfig());\n }\n\n var _wasCurrentDepth = this.currentDepth;\n var _wasWrapper = this.wrapper;\n this.wrapper = nodeName === 'pre' ? 'pre' : this.wrapper;\n\n if (typeof blockType !== 'string') {\n blockType = this.disambiguate(nodeName, this.wrapper) || blockType[0] || 'unstyled';\n }\n\n if (!experimentalTreeDataSupport && node instanceof HTMLElement && (blockType === 'unordered-list-item' || blockType === 'ordered-list-item')) {\n this.currentDepth = getListItemDepth(node, this.currentDepth);\n }\n\n var _key = generateRandomKey();\n var _childConfigs = this._toBlockConfigs(Array.from(node.childNodes));\n this._trimCurrentText();\n blockConfigs.push(this._makeBlockConfig({\n key: _key,\n childConfigs: _childConfigs,\n type: blockType\n }));\n\n this.currentDepth = _wasCurrentDepth;\n this.wrapper = _wasWrapper;\n continue;\n }\n\n if (nodeName === '#text') {\n this._addTextNode(node);\n continue;\n }\n\n if (isValidImage(node)) {\n this._addImgNode(node);\n continue;\n }\n\n if (isValidAnchor(node)) {\n this._addAnchorNode(node, blockConfigs);\n continue;\n }\n\n var inlineStyle = HTMLTagToInlineStyleMap.get(nodeName);\n if (inlineStyle !== undefined) {\n this.addStyle(inlineStyle);\n }\n\n blockConfigs.push.apply(blockConfigs, this._toBlockConfigs(Array.from(node.childNodes)));\n\n if (inlineStyle !== undefined) {\n this.removeStyle(inlineStyle);\n }\n\n this._updateStyleFromNodeAttributes(node);\n }\n\n return blockConfigs;\n };\n\n /**\n * Append a string of text to the internal buffer.\n */\n\n\n ContentBlocksBuilder.prototype._appendText = function _appendText(text) {\n var _characterList;\n\n this.currentText += text;\n var characterMetadata = CharacterMetadata.create({\n style: this.currentStyle,\n entity: this.currentEntity\n });\n this.characterList = (_characterList = this.characterList).push.apply(_characterList, Array(text.length).fill(characterMetadata));\n };\n\n /**\n * Trim the text in the internal buffer.\n */\n\n\n ContentBlocksBuilder.prototype._trimCurrentText = function _trimCurrentText() {\n var l = this.currentText.length;\n var begin = l - this.currentText.trimLeft().length;\n var end = this.currentText.trimRight().length;\n\n // We should not trim whitespaces for which an entity is defined.\n var entity = this.characterList.findEntry(function (characterMetadata) {\n return characterMetadata.getEntity() !== null;\n });\n begin = entity !== undefined ? Math.min(begin, entity[0]) : begin;\n\n entity = this.characterList.reverse().findEntry(function (characterMetadata) {\n return characterMetadata.getEntity() !== null;\n });\n end = entity !== undefined ? Math.max(end, l - entity[0]) : end;\n\n if (begin > end) {\n this.currentText = '';\n this.characterList = List();\n } else {\n this.currentText = this.currentText.slice(begin, end);\n this.characterList = this.characterList.slice(begin, end);\n }\n };\n\n /**\n * Add the content of an HTML text node to the internal state\n */\n\n\n ContentBlocksBuilder.prototype._addTextNode = function _addTextNode(node) {\n var text = node.textContent;\n var trimmedText = text.trim();\n\n // If we are not in a pre block and the trimmed content is empty,\n // normalize to a single space.\n if (trimmedText === '' && this.wrapper !== 'pre') {\n text = ' ';\n }\n\n if (this.wrapper !== 'pre') {\n // Can't use empty string because MSWord\n text = text.replace(REGEX_LF, SPACE);\n }\n\n this._appendText(text);\n };\n\n /**\n * Add the content of an HTML img node to the internal state\n */\n\n\n ContentBlocksBuilder.prototype._addImgNode = function _addImgNode(node) {\n if (!(node instanceof HTMLImageElement)) {\n return;\n }\n var image = node;\n var entityConfig = {};\n\n imgAttr.forEach(function (attr) {\n var imageAttribute = image.getAttribute(attr);\n if (imageAttribute) {\n entityConfig[attr] = imageAttribute;\n }\n });\n\n // TODO: T15530363 update this when we remove DraftEntity entirely\n this.currentEntity = this.entityMap.__create('IMAGE', 'MUTABLE', entityConfig);\n\n // The child text node cannot just have a space or return as content -\n // we strip those out.\n // See https://github.com/facebook/draft-js/issues/231 for some context.\n\n this._appendText('\\uD83D\\uDCF7');\n this.currentEntity = null;\n };\n\n /**\n * Add the content of an HTML 'a' node to the internal state. Child nodes\n * (if any) are converted to Block Configs and appended to the provided\n * blockConfig array.\n */\n\n\n ContentBlocksBuilder.prototype._addAnchorNode = function _addAnchorNode(node, blockConfigs) {\n // The check has already been made by isValidAnchor but\n // we have to do it again to keep flow happy.\n if (!(node instanceof HTMLAnchorElement)) {\n return;\n }\n var anchor = node;\n var entityConfig = {};\n\n anchorAttr.forEach(function (attr) {\n var anchorAttribute = anchor.getAttribute(attr);\n if (anchorAttribute) {\n entityConfig[attr] = anchorAttribute;\n }\n });\n\n entityConfig.url = new URI(anchor.href).toString();\n // TODO: T15530363 update this when we remove DraftEntity completely\n this.currentEntity = this.entityMap.__create('LINK', 'MUTABLE', entityConfig || {});\n\n blockConfigs.push.apply(blockConfigs, this._toBlockConfigs(Array.from(node.childNodes)));\n this.currentEntity = null;\n };\n\n /**\n * Try to guess the inline style of an HTML element based on its css\n * styles (font-weight, font-style and text-decoration).\n */\n\n\n ContentBlocksBuilder.prototype._updateStyleFromNodeAttributes = function _updateStyleFromNodeAttributes(node) {\n if (!(node instanceof HTMLElement)) {\n return;\n }\n\n var htmlElement = node;\n var fontWeight = htmlElement.style.fontWeight;\n var fontStyle = htmlElement.style.fontStyle;\n var textDecoration = htmlElement.style.textDecoration;\n\n if (boldValues.indexOf(fontWeight) >= 0) {\n this.addStyle('BOLD');\n } else if (notBoldValues.indexOf(fontWeight) >= 0) {\n this.removeStyle('BOLD');\n }\n\n if (fontStyle === 'italic') {\n this.addStyle('ITALIC');\n } else if (fontStyle === 'normal') {\n this.removeStyle('ITALIC');\n }\n\n if (textDecoration === 'underline') {\n this.addStyle('UNDERLINE');\n }\n if (textDecoration === 'line-through') {\n this.addStyle('STRIKETHROUGH');\n }\n if (textDecoration === 'none') {\n this.removeStyle('UNDERLINE');\n this.removeStyle('STRIKETHROUGH');\n }\n };\n\n /**\n * Walk the BlockConfig tree, compute parent/children/siblings,\n * and generate the corresponding ContentBlockNode\n */\n\n\n ContentBlocksBuilder.prototype._toContentBlocks = function _toContentBlocks(blockConfigs) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var l = blockConfigs.length - 1;\n for (var i = 0; i <= l; i++) {\n var config = blockConfigs[i];\n config.parent = parent;\n config.prevSibling = i > 0 ? blockConfigs[i - 1].key : null;\n config.nextSibling = i < l ? blockConfigs[i + 1].key : null;\n config.children = List(config.childConfigs.map(function (child) {\n return child.key;\n }));\n this.contentBlocks.push(new ContentBlockNode(_extends({}, config)));\n this._toContentBlocks(config.childConfigs, config.key);\n }\n };\n\n // ***********************************************************************\n // The two methods below are used for backward compatibility when\n // experimentalTreeDataSupport is disabled.\n\n /**\n * Same as _toContentBlocks but replaces nested blocks by their\n * text content.\n */\n\n\n ContentBlocksBuilder.prototype._toFlatContentBlocks = function _toFlatContentBlocks(blockConfigs) {\n var l = blockConfigs.length - 1;\n for (var i = 0; i <= l; i++) {\n var config = blockConfigs[i];\n\n var _extractTextFromBlock = this._extractTextFromBlockConfigs(config.childConfigs),\n _text = _extractTextFromBlock.text,\n _characterList2 = _extractTextFromBlock.characterList;\n\n this.contentBlocks.push(new ContentBlock(_extends({}, config, {\n text: config.text + _text,\n characterList: config.characterList.concat(_characterList2)\n })));\n }\n };\n\n /**\n * Extract the text and the associated inline styles form an\n * array of content block configs.\n */\n\n\n ContentBlocksBuilder.prototype._extractTextFromBlockConfigs = function _extractTextFromBlockConfigs(blockConfigs) {\n var l = blockConfigs.length - 1;\n var text = '';\n var characterList = List();\n for (var i = 0; i <= l; i++) {\n var config = blockConfigs[i];\n text += config.text;\n characterList = characterList.concat(config.characterList);\n /* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error\n * found when Flow v0.68 was deployed. To see the error delete this\n * comment and run Flow. */\n if (text !== '' && config.blockType !== 'unstyled') {\n text += '\\n';\n characterList = characterList.push(characterList.last());\n }\n var _children = this._extractTextFromBlockConfigs(config.childConfigs);\n text += _children.text;\n characterList = characterList.concat(_children.characterList);\n }\n return { text: text, characterList: characterList };\n };\n\n return ContentBlocksBuilder;\n}();\n\n/**\n * Converts an HTML string to an array of ContentBlocks and an EntityMap\n * suitable to initialize the internal state of a Draftjs component.\n */\n\n\nvar convertFromHTMLtoContentBlocks = function convertFromHTMLtoContentBlocks(html) {\n var DOMBuilder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getSafeBodyFromHTML;\n var blockRenderMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DefaultDraftBlockRenderMap;\n\n // Be ABSOLUTELY SURE that the dom builder you pass here won't execute\n // arbitrary code in whatever environment you're running this in. For an\n // example of how we try to do this in-browser, see getSafeBodyFromHTML.\n\n // Remove funky characters from the HTML string\n html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE).replace(REGEX_CARRIAGE, '').replace(REGEX_ZWS, '');\n\n // Build a DOM tree out of the HTML string\n var safeBody = DOMBuilder(html);\n if (!safeBody) {\n return null;\n }\n\n // Build a BlockTypeMap out of the BlockRenderMap\n var blockTypeMap = buildBlockTypeMap(blockRenderMap);\n\n // Select the proper block type for the cases where the blockRenderMap\n // uses multiple block types for the same html tag.\n var disambiguate = function disambiguate(tag, wrapper) {\n if (tag === 'li') {\n return wrapper === 'ol' ? 'ordered-list-item' : 'unordered-list-item';\n }\n return null;\n };\n\n return new ContentBlocksBuilder(blockTypeMap, disambiguate).addDOMNode(safeBody).getContentBlocks();\n};\n\nmodule.exports = convertFromHTMLtoContentBlocks;"},{"id":66,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/RichTextEditorUtil.js","name":"./lib/RichTextEditorUtil.js","index":141,"index2":138,"size":10396,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./RichTextEditorUtil","loc":"30:25-56"},{"moduleId":142,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnPaste.js","module":"./lib/editOnPaste.js","moduleName":"./lib/editOnPaste.js","type":"cjs require","userRequest":"./RichTextEditorUtil","loc":"21:25-56"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar SelectionState = require('./SelectionState');\n\nvar adjustBlockDepthForContentState = require('./adjustBlockDepthForContentState');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar RichTextEditorUtil = {\n currentBlockContainsLink: function currentBlockContainsLink(editorState) {\n var selection = editorState.getSelection();\n var contentState = editorState.getCurrentContent();\n var entityMap = contentState.getEntityMap();\n return contentState.getBlockForKey(selection.getAnchorKey()).getCharacterList().slice(selection.getStartOffset(), selection.getEndOffset()).some(function (v) {\n var entity = v.getEntity();\n return !!entity && entityMap.__get(entity).getType() === 'LINK';\n });\n },\n\n getCurrentBlockType: function getCurrentBlockType(editorState) {\n var selection = editorState.getSelection();\n return editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();\n },\n\n getDataObjectForLinkURL: function getDataObjectForLinkURL(uri) {\n return { url: uri.toString() };\n },\n\n handleKeyCommand: function handleKeyCommand(editorState, command, eventTimeStamp) {\n switch (command) {\n case 'bold':\n return RichTextEditorUtil.toggleInlineStyle(editorState, 'BOLD');\n case 'italic':\n return RichTextEditorUtil.toggleInlineStyle(editorState, 'ITALIC');\n case 'underline':\n return RichTextEditorUtil.toggleInlineStyle(editorState, 'UNDERLINE');\n case 'code':\n return RichTextEditorUtil.toggleCode(editorState);\n case 'backspace':\n case 'backspace-word':\n case 'backspace-to-start-of-line':\n return RichTextEditorUtil.onBackspace(editorState);\n case 'delete':\n case 'delete-word':\n case 'delete-to-end-of-block':\n return RichTextEditorUtil.onDelete(editorState);\n default:\n // they may have custom editor commands; ignore those\n return null;\n }\n },\n\n insertSoftNewline: function insertSoftNewline(editorState) {\n var contentState = DraftModifier.insertText(editorState.getCurrentContent(), editorState.getSelection(), '\\n', editorState.getCurrentInlineStyle(), null);\n\n var newEditorState = EditorState.push(editorState, contentState, 'insert-characters');\n\n return EditorState.forceSelection(newEditorState, contentState.getSelectionAfter());\n },\n\n /**\n * For collapsed selections at the start of styled blocks, backspace should\n * just remove the existing style.\n */\n onBackspace: function onBackspace(editorState) {\n var selection = editorState.getSelection();\n if (!selection.isCollapsed() || selection.getAnchorOffset() || selection.getFocusOffset()) {\n return null;\n }\n\n // First, try to remove a preceding atomic block.\n var content = editorState.getCurrentContent();\n var startKey = selection.getStartKey();\n var blockBefore = content.getBlockBefore(startKey);\n\n if (blockBefore && blockBefore.getType() === 'atomic') {\n var blockMap = content.getBlockMap()['delete'](blockBefore.getKey());\n var withoutAtomicBlock = content.merge({\n blockMap: blockMap,\n selectionAfter: selection\n });\n if (withoutAtomicBlock !== content) {\n return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');\n }\n }\n\n // If that doesn't succeed, try to remove the current block style.\n var withoutBlockStyle = RichTextEditorUtil.tryToRemoveBlockStyle(editorState);\n\n if (withoutBlockStyle) {\n return EditorState.push(editorState, withoutBlockStyle, 'change-block-type');\n }\n\n return null;\n },\n\n onDelete: function onDelete(editorState) {\n var selection = editorState.getSelection();\n if (!selection.isCollapsed()) {\n return null;\n }\n\n var content = editorState.getCurrentContent();\n var startKey = selection.getStartKey();\n var block = content.getBlockForKey(startKey);\n var length = block.getLength();\n\n // The cursor is somewhere within the text. Behave normally.\n if (selection.getStartOffset() < length) {\n return null;\n }\n\n var blockAfter = content.getBlockAfter(startKey);\n\n if (!blockAfter || blockAfter.getType() !== 'atomic') {\n return null;\n }\n\n var atomicBlockTarget = selection.merge({\n focusKey: blockAfter.getKey(),\n focusOffset: blockAfter.getLength()\n });\n\n var withoutAtomicBlock = DraftModifier.removeRange(content, atomicBlockTarget, 'forward');\n\n if (withoutAtomicBlock !== content) {\n return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');\n }\n\n return null;\n },\n\n onTab: function onTab(event, editorState, maxDepth) {\n var selection = editorState.getSelection();\n var key = selection.getAnchorKey();\n if (key !== selection.getFocusKey()) {\n return editorState;\n }\n\n var content = editorState.getCurrentContent();\n var block = content.getBlockForKey(key);\n var type = block.getType();\n if (type !== 'unordered-list-item' && type !== 'ordered-list-item') {\n return editorState;\n }\n\n event.preventDefault();\n\n var depth = block.getDepth();\n if (!event.shiftKey && depth === maxDepth) {\n return editorState;\n }\n\n var withAdjustment = adjustBlockDepthForContentState(content, selection, event.shiftKey ? -1 : 1, maxDepth);\n\n return EditorState.push(editorState, withAdjustment, 'adjust-depth');\n },\n\n toggleBlockType: function toggleBlockType(editorState, blockType) {\n var selection = editorState.getSelection();\n var startKey = selection.getStartKey();\n var endKey = selection.getEndKey();\n var content = editorState.getCurrentContent();\n var target = selection;\n\n // Triple-click can lead to a selection that includes offset 0 of the\n // following block. The `SelectionState` for this case is accurate, but\n // we should avoid toggling block type for the trailing block because it\n // is a confusing interaction.\n if (startKey !== endKey && selection.getEndOffset() === 0) {\n var blockBefore = nullthrows(content.getBlockBefore(endKey));\n endKey = blockBefore.getKey();\n target = target.merge({\n anchorKey: startKey,\n anchorOffset: selection.getStartOffset(),\n focusKey: endKey,\n focusOffset: blockBefore.getLength(),\n isBackward: false\n });\n }\n\n var hasAtomicBlock = content.getBlockMap().skipWhile(function (_, k) {\n return k !== startKey;\n }).reverse().skipWhile(function (_, k) {\n return k !== endKey;\n }).some(function (v) {\n return v.getType() === 'atomic';\n });\n\n if (hasAtomicBlock) {\n return editorState;\n }\n\n var typeToSet = content.getBlockForKey(startKey).getType() === blockType ? 'unstyled' : blockType;\n\n return EditorState.push(editorState, DraftModifier.setBlockType(content, target, typeToSet), 'change-block-type');\n },\n\n toggleCode: function toggleCode(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var focusKey = selection.getFocusKey();\n\n if (selection.isCollapsed() || anchorKey !== focusKey) {\n return RichTextEditorUtil.toggleBlockType(editorState, 'code-block');\n }\n\n return RichTextEditorUtil.toggleInlineStyle(editorState, 'CODE');\n },\n\n /**\n * Toggle the specified inline style for the selection. If the\n * user's selection is collapsed, apply or remove the style for the\n * internal state. If it is not collapsed, apply the change directly\n * to the document state.\n */\n toggleInlineStyle: function toggleInlineStyle(editorState, inlineStyle) {\n var selection = editorState.getSelection();\n var currentStyle = editorState.getCurrentInlineStyle();\n\n // If the selection is collapsed, toggle the specified style on or off and\n // set the result as the new inline style override. This will then be\n // used as the inline style for the next character to be inserted.\n if (selection.isCollapsed()) {\n return EditorState.setInlineStyleOverride(editorState, currentStyle.has(inlineStyle) ? currentStyle.remove(inlineStyle) : currentStyle.add(inlineStyle));\n }\n\n // If characters are selected, immediately apply or remove the\n // inline style on the document state itself.\n var content = editorState.getCurrentContent();\n var newContent = void 0;\n\n // If the style is already present for the selection range, remove it.\n // Otherwise, apply it.\n if (currentStyle.has(inlineStyle)) {\n newContent = DraftModifier.removeInlineStyle(content, selection, inlineStyle);\n } else {\n newContent = DraftModifier.applyInlineStyle(content, selection, inlineStyle);\n }\n\n return EditorState.push(editorState, newContent, 'change-inline-style');\n },\n\n toggleLink: function toggleLink(editorState, targetSelection, entityKey) {\n var withoutLink = DraftModifier.applyEntity(editorState.getCurrentContent(), targetSelection, entityKey);\n\n return EditorState.push(editorState, withoutLink, 'apply-entity');\n },\n\n /**\n * When a collapsed cursor is at the start of a styled block, changes block\n * type to 'unstyled'. Returns null if selection does not meet that criteria.\n */\n tryToRemoveBlockStyle: function tryToRemoveBlockStyle(editorState) {\n var selection = editorState.getSelection();\n var offset = selection.getAnchorOffset();\n if (selection.isCollapsed() && offset === 0) {\n var key = selection.getAnchorKey();\n var content = editorState.getCurrentContent();\n var block = content.getBlockForKey(key);\n\n var type = block.getType();\n var blockBefore = content.getBlockBefore(key);\n if (type === 'code-block' && blockBefore && blockBefore.getType() === 'code-block' && blockBefore.getLength() !== 0) {\n return null;\n }\n\n if (type !== 'unstyled') {\n return DraftModifier.setBlockType(content, selection, 'unstyled');\n }\n }\n return null;\n }\n};\n\nmodule.exports = RichTextEditorUtil;"},{"id":67,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getDefaultKeyBinding.js","name":"./lib/getDefaultKeyBinding.js","index":148,"index2":146,"size":3405,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./getDefaultKeyBinding","loc":"36:27-60"},{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./getDefaultKeyBinding","loc":"44:27-60"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar KeyBindingUtil = require('./KeyBindingUtil');\nvar Keys = require('fbjs/lib/Keys');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar isOSX = UserAgent.isPlatform('Mac OS X');\n\n// Firefox on OSX had a bug resulting in navigation instead of cursor movement.\n// This bug was fixed in Firefox 29. Feature detection is virtually impossible\n// so we just check the version number. See #342765.\nvar shouldFixFirefoxMovement = isOSX && UserAgent.isBrowser('Firefox < 29');\n\nvar hasCommandModifier = KeyBindingUtil.hasCommandModifier,\n isCtrlKeyCommand = KeyBindingUtil.isCtrlKeyCommand;\n\n\nfunction shouldRemoveWord(e) {\n return isOSX && e.altKey || isCtrlKeyCommand(e);\n}\n\n/**\n * Get the appropriate undo/redo command for a Z key command.\n */\nfunction getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}\n\nfunction getDeleteCommand(e) {\n // Allow default \"cut\" behavior for PCs on Shift + Delete.\n if (!isOSX && e.shiftKey) {\n return null;\n }\n return shouldRemoveWord(e) ? 'delete-word' : 'delete';\n}\n\nfunction getBackspaceCommand(e) {\n if (hasCommandModifier(e) && isOSX) {\n return 'backspace-to-start-of-line';\n }\n return shouldRemoveWord(e) ? 'backspace-word' : 'backspace';\n}\n\n/**\n * Retrieve a bound key command for the given event.\n */\nfunction getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return isOSX && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isOSX ? 'secondary-paste' : 'redo';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}\n\nmodule.exports = getDefaultKeyBinding;"},{"id":68,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftStringKey.js","name":"./lib/DraftStringKey.js","index":150,"index2":148,"size":556,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","issuerId":150,"issuerName":"./lib/convertFromDraftStateToRaw.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":150,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/convertFromDraftStateToRaw.js","module":"./lib/convertFromDraftStateToRaw.js","moduleName":"./lib/convertFromDraftStateToRaw.js","type":"cjs require","userRequest":"./DraftStringKey","loc":"21:21-48"},{"moduleId":151,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/encodeEntityRanges.js","module":"./lib/encodeEntityRanges.js","moduleName":"./lib/encodeEntityRanges.js","type":"cjs require","userRequest":"./DraftStringKey","loc":"15:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict\n */\n\n'use strict';\n\nvar DraftStringKey = {\n stringify: function stringify(key) {\n return '_' + String(key);\n },\n\n unstringify: function unstringify(key) {\n return key.slice(1);\n }\n};\n\nmodule.exports = DraftStringKey;"},{"id":69,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","name":"./lib/Draft.js","index":0,"index2":159,"size":2705,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":null,"issuerId":null,"issuerName":null,"failed":false,"errors":0,"warnings":0,"reasons":[],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":0,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar AtomicBlockUtils = require('./AtomicBlockUtils');\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar CompositeDraftDecorator = require('./CompositeDraftDecorator');\nvar ContentBlock = require('./ContentBlock');\nvar ContentState = require('./ContentState');\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DefaultDraftInlineStyle = require('./DefaultDraftInlineStyle');\nvar DraftEditor = require('./DraftEditor.react');\nvar DraftEditorBlock = require('./DraftEditorBlock.react');\nvar DraftEntity = require('./DraftEntity');\nvar DraftModifier = require('./DraftModifier');\nvar DraftEntityInstance = require('./DraftEntityInstance');\nvar EditorState = require('./EditorState');\nvar KeyBindingUtil = require('./KeyBindingUtil');\nvar RichTextEditorUtil = require('./RichTextEditorUtil');\nvar SelectionState = require('./SelectionState');\n\nvar convertFromDraftStateToRaw = require('./convertFromDraftStateToRaw');\nvar convertFromRawToDraftState = require('./convertFromRawToDraftState');\nvar generateRandomKey = require('./generateRandomKey');\nvar getDefaultKeyBinding = require('./getDefaultKeyBinding');\nvar getVisibleSelectionRect = require('./getVisibleSelectionRect');\nvar gkx = require('./gkx');\n\nvar convertFromHTML = gkx('draft_refactored_html_importer') ? require('./convertFromHTMLToContentBlocks2') : require('./convertFromHTMLToContentBlocks');\n\nvar DraftPublic = {\n Editor: DraftEditor,\n EditorBlock: DraftEditorBlock,\n EditorState: EditorState,\n\n CompositeDecorator: CompositeDraftDecorator,\n Entity: DraftEntity,\n EntityInstance: DraftEntityInstance,\n\n BlockMapBuilder: BlockMapBuilder,\n CharacterMetadata: CharacterMetadata,\n ContentBlock: ContentBlock,\n ContentState: ContentState,\n SelectionState: SelectionState,\n\n AtomicBlockUtils: AtomicBlockUtils,\n KeyBindingUtil: KeyBindingUtil,\n Modifier: DraftModifier,\n RichUtils: RichTextEditorUtil,\n\n DefaultDraftBlockRenderMap: DefaultDraftBlockRenderMap,\n DefaultDraftInlineStyle: DefaultDraftInlineStyle,\n\n convertFromHTML: convertFromHTML,\n convertFromRaw: convertFromRawToDraftState,\n convertToRaw: convertFromDraftStateToRaw,\n genKey: generateRandomKey,\n getDefaultKeyBinding: getDefaultKeyBinding,\n getVisibleSelectionRect: getVisibleSelectionRect\n};\n\nmodule.exports = DraftPublic;"},{"id":70,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","name":"./lib/AtomicBlockUtils.js","index":1,"index2":41,"size":5051,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./AtomicBlockUtils","loc":"15:23-52"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar gkx = require('./gkx');\nvar moveBlockInContentState = require('./moveBlockInContentState');\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\nvar ContentBlockRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\nvar List = Immutable.List,\n Repeat = Immutable.Repeat;\n\n\nvar AtomicBlockUtils = {\n insertAtomicBlock: function insertAtomicBlock(editorState, entityKey, character) {\n var contentState = editorState.getCurrentContent();\n var selectionState = editorState.getSelection();\n\n var afterRemoval = DraftModifier.removeRange(contentState, selectionState, 'backward');\n\n var targetSelection = afterRemoval.getSelectionAfter();\n var afterSplit = DraftModifier.splitBlock(afterRemoval, targetSelection);\n var insertionTarget = afterSplit.getSelectionAfter();\n\n var asAtomicBlock = DraftModifier.setBlockType(afterSplit, insertionTarget, 'atomic');\n\n var charData = CharacterMetadata.create({ entity: entityKey });\n\n var atomicBlockConfig = {\n key: generateRandomKey(),\n type: 'atomic',\n text: character,\n characterList: List(Repeat(charData, character.length))\n };\n\n var atomicDividerBlockConfig = {\n key: generateRandomKey(),\n type: 'unstyled'\n };\n\n if (experimentalTreeDataSupport) {\n atomicBlockConfig = _extends({}, atomicBlockConfig, {\n nextSibling: atomicDividerBlockConfig.key\n });\n atomicDividerBlockConfig = _extends({}, atomicDividerBlockConfig, {\n prevSibling: atomicBlockConfig.key\n });\n }\n\n var fragmentArray = [new ContentBlockRecord(atomicBlockConfig), new ContentBlockRecord(atomicDividerBlockConfig)];\n\n var fragment = BlockMapBuilder.createFromArray(fragmentArray);\n\n var withAtomicBlock = DraftModifier.replaceWithFragment(asAtomicBlock, insertionTarget, fragment);\n\n var newContent = withAtomicBlock.merge({\n selectionBefore: selectionState,\n selectionAfter: withAtomicBlock.getSelectionAfter().set('hasFocus', true)\n });\n\n return EditorState.push(editorState, newContent, 'insert-fragment');\n },\n\n moveAtomicBlock: function moveAtomicBlock(editorState, atomicBlock, targetRange, insertionMode) {\n var contentState = editorState.getCurrentContent();\n var selectionState = editorState.getSelection();\n\n var withMovedAtomicBlock = void 0;\n\n if (insertionMode === 'before' || insertionMode === 'after') {\n var targetBlock = contentState.getBlockForKey(insertionMode === 'before' ? targetRange.getStartKey() : targetRange.getEndKey());\n\n withMovedAtomicBlock = moveBlockInContentState(contentState, atomicBlock, targetBlock, insertionMode);\n } else {\n var afterRemoval = DraftModifier.removeRange(contentState, targetRange, 'backward');\n\n var selectionAfterRemoval = afterRemoval.getSelectionAfter();\n var _targetBlock = afterRemoval.getBlockForKey(selectionAfterRemoval.getFocusKey());\n\n if (selectionAfterRemoval.getStartOffset() === 0) {\n withMovedAtomicBlock = moveBlockInContentState(afterRemoval, atomicBlock, _targetBlock, 'before');\n } else if (selectionAfterRemoval.getEndOffset() === _targetBlock.getLength()) {\n withMovedAtomicBlock = moveBlockInContentState(afterRemoval, atomicBlock, _targetBlock, 'after');\n } else {\n var afterSplit = DraftModifier.splitBlock(afterRemoval, selectionAfterRemoval);\n\n var selectionAfterSplit = afterSplit.getSelectionAfter();\n var _targetBlock2 = afterSplit.getBlockForKey(selectionAfterSplit.getFocusKey());\n\n withMovedAtomicBlock = moveBlockInContentState(afterSplit, atomicBlock, _targetBlock2, 'before');\n }\n }\n\n var newContent = withMovedAtomicBlock.merge({\n selectionBefore: selectionState,\n selectionAfter: withMovedAtomicBlock.getSelectionAfter().set('hasFocus', true)\n });\n\n return EditorState.push(editorState, newContent, 'move-block');\n }\n};\n\nmodule.exports = AtomicBlockUtils;"},{"id":71,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/ContentStateInlineStyle.js","name":"./lib/ContentStateInlineStyle.js","index":10,"index2":7,"size":2234,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./ContentStateInlineStyle","loc":"16:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nvar _require = require('immutable'),\n Map = _require.Map;\n\nvar ContentStateInlineStyle = {\n add: function add(contentState, selectionState, inlineStyle) {\n return modifyInlineStyle(contentState, selectionState, inlineStyle, true);\n },\n\n remove: function remove(contentState, selectionState, inlineStyle) {\n return modifyInlineStyle(contentState, selectionState, inlineStyle, false);\n }\n};\n\nfunction modifyInlineStyle(contentState, selectionState, inlineStyle, addOrRemove) {\n var blockMap = contentState.getBlockMap();\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n\n var newBlocks = blockMap.skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat(Map([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {\n var sliceStart = void 0;\n var sliceEnd = void 0;\n\n if (startKey === endKey) {\n sliceStart = startOffset;\n sliceEnd = endOffset;\n } else {\n sliceStart = blockKey === startKey ? startOffset : 0;\n sliceEnd = blockKey === endKey ? endOffset : block.getLength();\n }\n\n var chars = block.getCharacterList();\n var current = void 0;\n while (sliceStart < sliceEnd) {\n current = chars.get(sliceStart);\n chars = chars.set(sliceStart, addOrRemove ? CharacterMetadata.applyStyle(current, inlineStyle) : CharacterMetadata.removeStyle(current, inlineStyle));\n sliceStart++;\n }\n\n return block.set('characterList', chars);\n });\n\n return contentState.merge({\n blockMap: blockMap.merge(newBlocks),\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}\n\nmodule.exports = ContentStateInlineStyle;"},{"id":72,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentState.js","name":"./lib/applyEntityToContentState.js","index":11,"index2":9,"size":1453,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./applyEntityToContentState","loc":"19:32-70"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar applyEntityToContentBlock = require('./applyEntityToContentBlock');\n\nfunction applyEntityToContentState(contentState, selectionState, entityKey) {\n var blockMap = contentState.getBlockMap();\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n\n var newBlocks = blockMap.skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).toOrderedMap().merge(Immutable.OrderedMap([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {\n var sliceStart = blockKey === startKey ? startOffset : 0;\n var sliceEnd = blockKey === endKey ? endOffset : block.getLength();\n return applyEntityToContentBlock(block, sliceStart, sliceEnd, entityKey);\n });\n\n return contentState.merge({\n blockMap: blockMap.merge(newBlocks),\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}\n\nmodule.exports = applyEntityToContentState;"},{"id":73,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentBlock.js","name":"./lib/applyEntityToContentBlock.js","index":12,"index2":8,"size":789,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentState.js","issuerId":72,"issuerName":"./lib/applyEntityToContentState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":72,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/applyEntityToContentState.js","module":"./lib/applyEntityToContentState.js","moduleName":"./lib/applyEntityToContentState.js","type":"cjs require","userRequest":"./applyEntityToContentBlock","loc":"17:32-70"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nfunction applyEntityToContentBlock(contentBlock, start, end, entityKey) {\n var characterList = contentBlock.getCharacterList();\n while (start < end) {\n characterList = characterList.set(start, CharacterMetadata.applyEntity(characterList.get(start), entityKey));\n start++;\n }\n return contentBlock.set('characterList', characterList);\n}\n\nmodule.exports = applyEntityToContentBlock;"},{"id":74,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","name":"./lib/getCharacterRemovalRange.js","index":13,"index2":13,"size":4528,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./getCharacterRemovalRange","loc":"20:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar DraftEntitySegments = require('./DraftEntitySegments');\n\nvar getRangesForDraftEntity = require('./getRangesForDraftEntity');\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Given a SelectionState and a removal direction, determine the entire range\n * that should be removed from a ContentState. This is based on any entities\n * within the target, with their `mutability` values taken into account.\n *\n * For instance, if we are attempting to remove part of an \"immutable\" entity\n * range, the entire entity must be removed. The returned `SelectionState`\n * will be adjusted accordingly.\n */\nfunction getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}\n\nfunction getEntityRemovalRange(entityMap, block, selectionState, direction, entityKey, isEntireSelectionWithinEntity, isEntityAtStart) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var entity = entityMap.__get(entityKey);\n var mutability = entity.getMutability();\n var sideToConsider = isEntityAtStart ? start : end;\n\n // `MUTABLE` entities can just have the specified range of text removed\n // directly. No adjustments are needed.\n if (mutability === 'MUTABLE') {\n return selectionState;\n }\n\n // Find the entity range that overlaps with our removal range.\n var entityRanges = getRangesForDraftEntity(block, entityKey).filter(function (range) {\n return sideToConsider <= range.end && sideToConsider >= range.start;\n });\n\n !(entityRanges.length == 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There should only be one entity range within this removal range.') : invariant(false) : void 0;\n\n var entityRange = entityRanges[0];\n\n // For `IMMUTABLE` entity types, we will remove the entire entity range.\n if (mutability === 'IMMUTABLE') {\n return selectionState.merge({\n anchorOffset: entityRange.start,\n focusOffset: entityRange.end,\n isBackward: false\n });\n }\n\n // For `SEGMENTED` entity types, determine the appropriate segment to\n // remove.\n if (!isEntireSelectionWithinEntity) {\n if (isEntityAtStart) {\n end = entityRange.end;\n } else {\n start = entityRange.start;\n }\n }\n\n var removalRange = DraftEntitySegments.getRemovalRange(start, end, block.getText().slice(entityRange.start, entityRange.end), entityRange.start, direction);\n\n return selectionState.merge({\n anchorOffset: removalRange.start,\n focusOffset: removalRange.end,\n isBackward: false\n });\n}\n\nmodule.exports = getCharacterRemovalRange;"},{"id":75,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEntitySegments.js","name":"./lib/DraftEntitySegments.js","index":14,"index2":10,"size":2561,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","issuerId":74,"issuerName":"./lib/getCharacterRemovalRange.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":74,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","module":"./lib/getCharacterRemovalRange.js","moduleName":"./lib/getCharacterRemovalRange.js","type":"cjs require","userRequest":"./DraftEntitySegments","loc":"15:26-58"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Identify the range to delete from a segmented entity.\n *\n * Rules:\n *\n * Example: 'John F. Kennedy'\n *\n * - Deletion from within any non-whitespace (i.e. ['John', 'F.', 'Kennedy'])\n * will return the range of that text.\n *\n * 'John F. Kennedy' -> 'John F.'\n * ^\n *\n * - Forward deletion of whitespace will remove the following section:\n *\n * 'John F. Kennedy' -> 'John Kennedy'\n * ^\n *\n * - Backward deletion of whitespace will remove the previous section:\n *\n * 'John F. Kennedy' -> 'F. Kennedy'\n * ^\n */\nvar DraftEntitySegments = {\n getRemovalRange: function getRemovalRange(selectionStart, selectionEnd, text, entityStart, direction) {\n var segments = text.split(' ');\n segments = segments.map(function ( /*string*/segment, /*number*/ii) {\n if (direction === 'forward') {\n if (ii > 0) {\n return ' ' + segment;\n }\n } else if (ii < segments.length - 1) {\n return segment + ' ';\n }\n return segment;\n });\n\n var segmentStart = entityStart;\n var segmentEnd = void 0;\n var segment = void 0;\n var removalStart = null;\n var removalEnd = null;\n\n for (var jj = 0; jj < segments.length; jj++) {\n segment = segments[jj];\n segmentEnd = segmentStart + segment.length;\n\n // Our selection overlaps this segment.\n if (selectionStart < segmentEnd && segmentStart < selectionEnd) {\n if (removalStart !== null) {\n removalEnd = segmentEnd;\n } else {\n removalStart = segmentStart;\n removalEnd = segmentEnd;\n }\n } else if (removalStart !== null) {\n break;\n }\n\n segmentStart = segmentEnd;\n }\n\n var entityEnd = entityStart + text.length;\n var atStart = removalStart === entityStart;\n var atEnd = removalEnd === entityEnd;\n\n if (!atStart && atEnd || atStart && !atEnd) {\n if (direction === 'forward') {\n if (removalEnd !== entityEnd) {\n removalEnd++;\n }\n } else if (removalStart !== entityStart) {\n removalStart--;\n }\n }\n\n return {\n start: removalStart,\n end: removalEnd\n };\n }\n};\n\nmodule.exports = DraftEntitySegments;"},{"id":76,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getRangesForDraftEntity.js","name":"./lib/getRangesForDraftEntity.js","index":15,"index2":12,"size":1113,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","issuerId":74,"issuerName":"./lib/getCharacterRemovalRange.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":74,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/getCharacterRemovalRange.js","module":"./lib/getCharacterRemovalRange.js","moduleName":"./lib/getCharacterRemovalRange.js","type":"cjs require","userRequest":"./getRangesForDraftEntity","loc":"17:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Obtain the start and end positions of the range that has the\n * specified entity applied to it.\n *\n * Entity keys are applied only to contiguous stretches of text, so this\n * method searches for the first instance of the entity key and returns\n * the subsequent range.\n */\nfunction getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}\n\nmodule.exports = getRangesForDraftEntity;"},{"id":77,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertFragmentIntoContentState.js","name":"./lib/insertFragmentIntoContentState.js","index":22,"index2":20,"size":9132,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./insertFragmentIntoContentState","loc":"23:37-80"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar insertIntoList = require('./insertIntoList');\nvar invariant = require('fbjs/lib/invariant');\nvar randomizeBlockMapKeys = require('./randomizeBlockMapKeys');\n\nvar List = Immutable.List;\n\n\nvar updateExistingBlock = function updateExistingBlock(contentState, selectionState, blockMap, fragmentBlock, targetKey, targetOffset) {\n var targetBlock = blockMap.get(targetKey);\n var text = targetBlock.getText();\n var chars = targetBlock.getCharacterList();\n var finalKey = targetKey;\n var finalOffset = targetOffset + fragmentBlock.getText().length;\n\n var newBlock = targetBlock.merge({\n text: text.slice(0, targetOffset) + fragmentBlock.getText() + text.slice(targetOffset),\n characterList: insertIntoList(chars, fragmentBlock.getCharacterList(), targetOffset),\n data: fragmentBlock.getData()\n });\n\n return contentState.merge({\n blockMap: blockMap.set(targetKey, newBlock),\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: finalKey,\n anchorOffset: finalOffset,\n focusKey: finalKey,\n focusOffset: finalOffset,\n isBackward: false\n })\n });\n};\n\n/**\n * Appends text/characterList from the fragment first block to\n * target block.\n */\nvar updateHead = function updateHead(block, targetOffset, fragment) {\n var text = block.getText();\n var chars = block.getCharacterList();\n\n // Modify head portion of block.\n var headText = text.slice(0, targetOffset);\n var headCharacters = chars.slice(0, targetOffset);\n var appendToHead = fragment.first();\n\n return block.merge({\n text: headText + appendToHead.getText(),\n characterList: headCharacters.concat(appendToHead.getCharacterList()),\n type: headText ? block.getType() : appendToHead.getType(),\n data: appendToHead.getData()\n });\n};\n\n/**\n * Appends offset text/characterList from the target block to the last\n * fragment block.\n */\nvar updateTail = function updateTail(block, targetOffset, fragment) {\n // Modify tail portion of block.\n var text = block.getText();\n var chars = block.getCharacterList();\n\n // Modify head portion of block.\n var blockSize = text.length;\n var tailText = text.slice(targetOffset, blockSize);\n var tailCharacters = chars.slice(targetOffset, blockSize);\n var prependToTail = fragment.last();\n\n return prependToTail.merge({\n text: prependToTail.getText() + tailText,\n characterList: prependToTail.getCharacterList().concat(tailCharacters),\n data: prependToTail.getData()\n });\n};\n\nvar getRootBlocks = function getRootBlocks(block, blockMap) {\n var headKey = block.getKey();\n var rootBlock = block;\n var rootBlocks = [];\n\n // sometimes the fragment head block will not be part of the blockMap itself this can happen when\n // the fragment head is used to update the target block, however when this does not happen we need\n // to make sure that we include it on the rootBlocks since the first block of a fragment is always a\n // fragment root block\n if (blockMap.get(headKey)) {\n rootBlocks.push(headKey);\n }\n\n while (rootBlock && rootBlock.getNextSiblingKey()) {\n var lastSiblingKey = rootBlock.getNextSiblingKey();\n\n if (!lastSiblingKey) {\n break;\n }\n\n rootBlocks.push(lastSiblingKey);\n rootBlock = blockMap.get(lastSiblingKey);\n }\n\n return rootBlocks;\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlockMap, targetBlock, fragmentHeadBlock) {\n return blockMap.withMutations(function (blockMapState) {\n var targetKey = targetBlock.getKey();\n var headKey = fragmentHeadBlock.getKey();\n var targetNextKey = targetBlock.getNextSiblingKey();\n var targetParentKey = targetBlock.getParentKey();\n var fragmentRootBlocks = getRootBlocks(fragmentHeadBlock, blockMap);\n var lastRootFragmentBlockKey = fragmentRootBlocks[fragmentRootBlocks.length - 1];\n\n if (blockMapState.get(headKey)) {\n // update the fragment head when it is part of the blockMap otherwise\n blockMapState.setIn([targetKey, 'nextSibling'], headKey);\n blockMapState.setIn([headKey, 'prevSibling'], targetKey);\n } else {\n // update the target block that had the fragment head contents merged into it\n blockMapState.setIn([targetKey, 'nextSibling'], fragmentHeadBlock.getNextSiblingKey());\n blockMapState.setIn([fragmentHeadBlock.getNextSiblingKey(), 'prevSibling'], targetKey);\n }\n\n // update the last root block fragment\n blockMapState.setIn([lastRootFragmentBlockKey, 'nextSibling'], targetNextKey);\n\n // update the original target next block\n if (targetNextKey) {\n blockMapState.setIn([targetNextKey, 'prevSibling'], lastRootFragmentBlockKey);\n }\n\n // update fragment parent links\n fragmentRootBlocks.forEach(function (blockKey) {\n return blockMapState.setIn([blockKey, 'parent'], targetParentKey);\n });\n\n // update targetBlock parent child links\n if (targetParentKey) {\n var targetParent = blockMap.get(targetParentKey);\n var originalTargetParentChildKeys = targetParent.getChildKeys();\n\n var targetBlockIndex = originalTargetParentChildKeys.indexOf(targetKey);\n var insertionIndex = targetBlockIndex + 1;\n\n var newChildrenKeysArray = originalTargetParentChildKeys.toArray();\n\n // insert fragment children\n newChildrenKeysArray.splice.apply(newChildrenKeysArray, [insertionIndex, 0].concat(fragmentRootBlocks));\n\n blockMapState.setIn([targetParentKey, 'children'], List(newChildrenKeysArray));\n }\n });\n};\n\nvar insertFragment = function insertFragment(contentState, selectionState, blockMap, fragment, targetKey, targetOffset) {\n var isTreeBasedBlockMap = blockMap.first() instanceof ContentBlockNode;\n var newBlockArr = [];\n var fragmentSize = fragment.size;\n var target = blockMap.get(targetKey);\n var head = fragment.first();\n var tail = fragment.last();\n var finalOffset = tail.getLength();\n var finalKey = tail.getKey();\n var shouldNotUpdateFromFragmentBlock = isTreeBasedBlockMap && (!target.getChildKeys().isEmpty() || !head.getChildKeys().isEmpty());\n\n blockMap.forEach(function (block, blockKey) {\n if (blockKey !== targetKey) {\n newBlockArr.push(block);\n return;\n }\n\n if (shouldNotUpdateFromFragmentBlock) {\n newBlockArr.push(block);\n } else {\n newBlockArr.push(updateHead(block, targetOffset, fragment));\n }\n\n // Insert fragment blocks after the head and before the tail.\n fragment\n // when we are updating the target block with the head fragment block we skip the first fragment\n // head since its contents have already been merged with the target block otherwise we include\n // the whole fragment\n .slice(shouldNotUpdateFromFragmentBlock ? 0 : 1, fragmentSize - 1).forEach(function (fragmentBlock) {\n return newBlockArr.push(fragmentBlock);\n });\n\n // update tail\n newBlockArr.push(updateTail(block, targetOffset, fragment));\n });\n\n var updatedBlockMap = BlockMapBuilder.createFromArray(newBlockArr);\n\n if (isTreeBasedBlockMap) {\n updatedBlockMap = updateBlockMapLinks(updatedBlockMap, blockMap, target, head);\n }\n\n return contentState.merge({\n blockMap: updatedBlockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: finalKey,\n anchorOffset: finalOffset,\n focusKey: finalKey,\n focusOffset: finalOffset,\n isBackward: false\n })\n });\n};\n\nvar insertFragmentIntoContentState = function insertFragmentIntoContentState(contentState, selectionState, fragmentBlockMap) {\n !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertFragment` should only be called with a collapsed selection state.') : invariant(false) : void 0;\n\n var blockMap = contentState.getBlockMap();\n var fragment = randomizeBlockMapKeys(fragmentBlockMap);\n var targetKey = selectionState.getStartKey();\n var targetOffset = selectionState.getStartOffset();\n\n var targetBlock = blockMap.get(targetKey);\n\n if (targetBlock instanceof ContentBlockNode) {\n !targetBlock.getChildKeys().isEmpty() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertFragment` should not be called when a container node is selected.') : invariant(false) : void 0;\n }\n\n // When we insert a fragment with a single block we simply update the target block\n // with the contents of the inserted fragment block\n if (fragment.size === 1) {\n return updateExistingBlock(contentState, selectionState, blockMap, fragment.first(), targetKey, targetOffset);\n }\n\n return insertFragment(contentState, selectionState, blockMap, fragment, targetKey, targetOffset);\n};\n\nmodule.exports = insertFragmentIntoContentState;"},{"id":78,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/insertTextIntoContentState.js","name":"./lib/insertTextIntoContentState.js","index":24,"index2":21,"size":1581,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./insertTextIntoContentState","loc":"24:33-72"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar insertIntoList = require('./insertIntoList');\nvar invariant = require('fbjs/lib/invariant');\n\nvar Repeat = Immutable.Repeat;\n\n\nfunction insertTextIntoContentState(contentState, selectionState, text, characterMetadata) {\n !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertText` should only be called with a collapsed range.') : invariant(false) : void 0;\n\n var len = text.length;\n if (!len) {\n return contentState;\n }\n\n var blockMap = contentState.getBlockMap();\n var key = selectionState.getStartKey();\n var offset = selectionState.getStartOffset();\n var block = blockMap.get(key);\n var blockText = block.getText();\n\n var newBlock = block.merge({\n text: blockText.slice(0, offset) + text + blockText.slice(offset, block.getLength()),\n characterList: insertIntoList(block.getCharacterList(), Repeat(characterMetadata, len).toList(), offset)\n });\n\n var newOffset = offset + len;\n\n return contentState.merge({\n blockMap: blockMap.set(key, newBlock),\n selectionAfter: selectionState.merge({\n anchorOffset: newOffset,\n focusOffset: newOffset\n })\n });\n}\n\nmodule.exports = insertTextIntoContentState;"},{"id":79,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/modifyBlockForContentState.js","name":"./lib/modifyBlockForContentState.js","index":25,"index2":22,"size":1048,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./modifyBlockForContentState","loc":"26:33-72"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar Map = Immutable.Map;\n\n\nfunction modifyBlockForContentState(contentState, selectionState, operation) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat(Map([[endKey, blockMap.get(endKey)]])).map(operation);\n\n return contentState.merge({\n blockMap: blockMap.merge(newBlocks),\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}\n\nmodule.exports = modifyBlockForContentState;"},{"id":80,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/removeRangeFromContentState.js","name":"./lib/removeRangeFromContentState.js","index":26,"index2":24,"size":9852,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./removeRangeFromContentState","loc":"28:34-74"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar getNextDelimiterBlockKey = require('./getNextDelimiterBlockKey');\n\nvar List = Immutable.List,\n Map = Immutable.Map;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n\n/**\n * Ancestors needs to be preserved when there are non selected\n * children to make sure we do not leave any orphans behind\n */\nvar getAncestorsKeys = function getAncestorsKeys(blockKey, blockMap) {\n var parents = [];\n\n if (!blockKey) {\n return parents;\n }\n\n var blockNode = blockMap.get(blockKey);\n while (blockNode && blockNode.getParentKey()) {\n var parentKey = blockNode.getParentKey();\n if (parentKey) {\n parents.push(parentKey);\n }\n blockNode = parentKey ? blockMap.get(parentKey) : null;\n }\n\n return parents;\n};\n\n/**\n * Get all next delimiter keys until we hit a root delimiter and return\n * an array of key references\n */\nvar getNextDelimitersBlockKeys = function getNextDelimitersBlockKeys(block, blockMap) {\n var nextDelimiters = [];\n\n if (!block) {\n return nextDelimiters;\n }\n\n var nextDelimiter = getNextDelimiterBlockKey(block, blockMap);\n while (nextDelimiter && blockMap.get(nextDelimiter)) {\n var _block = blockMap.get(nextDelimiter);\n nextDelimiters.push(nextDelimiter);\n\n // we do not need to keep checking all root node siblings, just the first occurance\n nextDelimiter = _block.getParentKey() ? getNextDelimiterBlockKey(_block, blockMap) : null;\n }\n\n return nextDelimiters;\n};\n\nvar getNextValidSibling = function getNextValidSibling(block, blockMap, originalBlockMap) {\n if (!block) {\n return null;\n }\n\n // note that we need to make sure we refer to the original block since this\n // function is called within a withMutations\n var nextValidSiblingKey = originalBlockMap.get(block.getKey()).getNextSiblingKey();\n\n while (nextValidSiblingKey && !blockMap.get(nextValidSiblingKey)) {\n nextValidSiblingKey = originalBlockMap.get(nextValidSiblingKey).getNextSiblingKey() || null;\n }\n\n return nextValidSiblingKey;\n};\n\nvar getPrevValidSibling = function getPrevValidSibling(block, blockMap, originalBlockMap) {\n if (!block) {\n return null;\n }\n\n // note that we need to make sure we refer to the original block since this\n // function is called within a withMutations\n var prevValidSiblingKey = originalBlockMap.get(block.getKey()).getPrevSiblingKey();\n\n while (prevValidSiblingKey && !blockMap.get(prevValidSiblingKey)) {\n prevValidSiblingKey = originalBlockMap.get(prevValidSiblingKey).getPrevSiblingKey() || null;\n }\n\n return prevValidSiblingKey;\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, startBlock, endBlock, originalBlockMap) {\n return blockMap.withMutations(function (blocks) {\n // update start block if its retained\n transformBlock(startBlock.getKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(startBlock, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(startBlock, blocks, originalBlockMap)\n });\n });\n\n // update endblock if its retained\n transformBlock(endBlock.getKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(endBlock, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(endBlock, blocks, originalBlockMap)\n });\n });\n\n // update start block parent ancestors\n getAncestorsKeys(startBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n return transformBlock(parentKey, blocks, function (block) {\n return block.merge({\n children: block.getChildKeys().filter(function (key) {\n return blocks.get(key);\n }),\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n });\n\n // update start block next - can only happen if startBlock == endBlock\n transformBlock(startBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: startBlock.getPrevSiblingKey()\n });\n });\n\n // update start block prev\n transformBlock(startBlock.getPrevSiblingKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(startBlock, blocks, originalBlockMap)\n });\n });\n\n // update end block next\n transformBlock(endBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: getPrevValidSibling(endBlock, blocks, originalBlockMap)\n });\n });\n\n // update end block prev\n transformBlock(endBlock.getPrevSiblingKey(), blocks, function (block) {\n return block.merge({\n nextSibling: endBlock.getNextSiblingKey()\n });\n });\n\n // update end block parent ancestors\n getAncestorsKeys(endBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n transformBlock(parentKey, blocks, function (block) {\n return block.merge({\n children: block.getChildKeys().filter(function (key) {\n return blocks.get(key);\n }),\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n });\n\n // update next delimiters all the way to a root delimiter\n getNextDelimitersBlockKeys(endBlock, originalBlockMap).forEach(function (delimiterKey) {\n return transformBlock(delimiterKey, blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n });\n });\n};\n\nvar removeRangeFromContentState = function removeRangeFromContentState(contentState, selectionState) {\n if (selectionState.isCollapsed()) {\n return contentState;\n }\n\n var blockMap = contentState.getBlockMap();\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n\n var startBlock = blockMap.get(startKey);\n var endBlock = blockMap.get(endKey);\n\n // we assume that ContentBlockNode and ContentBlocks are not mixed together\n var isExperimentalTreeBlock = startBlock instanceof ContentBlockNode;\n\n // used to retain blocks that should not be deleted to avoid orphan children\n var parentAncestors = [];\n\n if (isExperimentalTreeBlock) {\n var endBlockchildrenKeys = endBlock.getChildKeys();\n var endBlockAncestors = getAncestorsKeys(endKey, blockMap);\n\n // endBlock has unselected sibblings so we can not remove its ancestors parents\n if (endBlock.getNextSiblingKey()) {\n parentAncestors = parentAncestors.concat(endBlockAncestors);\n }\n\n // endBlock has children so can not remove this block or any of its ancestors\n if (!endBlockchildrenKeys.isEmpty()) {\n parentAncestors = parentAncestors.concat(endBlockAncestors.concat([endKey]));\n }\n\n // we need to retain all ancestors of the next delimiter block\n parentAncestors = parentAncestors.concat(getAncestorsKeys(getNextDelimiterBlockKey(endBlock, blockMap), blockMap));\n }\n\n var characterList = void 0;\n\n if (startBlock === endBlock) {\n characterList = removeFromList(startBlock.getCharacterList(), startOffset, endOffset);\n } else {\n characterList = startBlock.getCharacterList().slice(0, startOffset).concat(endBlock.getCharacterList().slice(endOffset));\n }\n\n var modifiedStart = startBlock.merge({\n text: startBlock.getText().slice(0, startOffset) + endBlock.getText().slice(endOffset),\n characterList: characterList\n });\n\n var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).filter(function (_, k) {\n return parentAncestors.indexOf(k) === -1;\n }).concat(Map([[endKey, null]])).map(function (_, k) {\n return k === startKey ? modifiedStart : null;\n });\n\n var updatedBlockMap = blockMap.merge(newBlocks).filter(function (block) {\n return !!block;\n });\n\n if (isExperimentalTreeBlock) {\n updatedBlockMap = updateBlockMapLinks(updatedBlockMap, startBlock, endBlock, blockMap);\n }\n\n return contentState.merge({\n blockMap: updatedBlockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: startKey,\n anchorOffset: startOffset,\n focusKey: startKey,\n focusOffset: startOffset,\n isBackward: false\n })\n });\n};\n\n/**\n * Maintain persistence for target list when removing characters on the\n * head and tail of the character list.\n */\nvar removeFromList = function removeFromList(targetList, startOffset, endOffset) {\n if (startOffset === 0) {\n while (startOffset < endOffset) {\n targetList = targetList.shift();\n startOffset++;\n }\n } else if (endOffset === targetList.count()) {\n while (endOffset > startOffset) {\n targetList = targetList.pop();\n endOffset--;\n }\n } else {\n var head = targetList.slice(0, startOffset);\n var tail = targetList.slice(endOffset);\n targetList = head.concat(tail).toList();\n }\n return targetList;\n};\n\nmodule.exports = removeRangeFromContentState;"},{"id":81,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/splitBlockInContentState.js","name":"./lib/splitBlockInContentState.js","index":28,"index2":25,"size":3858,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","issuerId":5,"issuerName":"./lib/DraftModifier.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":5,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftModifier.js","module":"./lib/DraftModifier.js","moduleName":"./lib/DraftModifier.js","type":"cjs require","userRequest":"./splitBlockInContentState","loc":"29:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar invariant = require('fbjs/lib/invariant');\n\nvar List = Immutable.List,\n Map = Immutable.Map;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlock, belowBlock) {\n return blockMap.withMutations(function (blocks) {\n var originalBlockKey = originalBlock.getKey();\n var belowBlockKey = belowBlock.getKey();\n\n // update block parent\n transformBlock(originalBlock.getParentKey(), blocks, function (block) {\n var parentChildrenList = block.getChildKeys();\n var insertionIndex = parentChildrenList.indexOf(originalBlockKey) + 1;\n var newChildrenArray = parentChildrenList.toArray();\n\n newChildrenArray.splice(insertionIndex, 0, belowBlockKey);\n\n return block.merge({\n children: List(newChildrenArray)\n });\n });\n\n // update original next block\n transformBlock(originalBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: belowBlockKey\n });\n });\n\n // update original block\n transformBlock(originalBlockKey, blocks, function (block) {\n return block.merge({\n nextSibling: belowBlockKey\n });\n });\n\n // update below block\n transformBlock(belowBlockKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalBlockKey\n });\n });\n });\n};\n\nvar splitBlockInContentState = function splitBlockInContentState(contentState, selectionState) {\n !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Selection range must be collapsed.') : invariant(false) : void 0;\n\n var key = selectionState.getAnchorKey();\n var offset = selectionState.getAnchorOffset();\n var blockMap = contentState.getBlockMap();\n var blockToSplit = blockMap.get(key);\n var text = blockToSplit.getText();\n var chars = blockToSplit.getCharacterList();\n var keyBelow = generateRandomKey();\n var isExperimentalTreeBlock = blockToSplit instanceof ContentBlockNode;\n\n var blockAbove = blockToSplit.merge({\n text: text.slice(0, offset),\n characterList: chars.slice(0, offset)\n });\n var blockBelow = blockAbove.merge({\n key: keyBelow,\n text: text.slice(offset),\n characterList: chars.slice(offset),\n data: Map()\n });\n\n var blocksBefore = blockMap.toSeq().takeUntil(function (v) {\n return v === blockToSplit;\n });\n var blocksAfter = blockMap.toSeq().skipUntil(function (v) {\n return v === blockToSplit;\n }).rest();\n var newBlocks = blocksBefore.concat([[key, blockAbove], [keyBelow, blockBelow]], blocksAfter).toOrderedMap();\n\n if (isExperimentalTreeBlock) {\n !blockToSplit.getChildKeys().isEmpty() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ContentBlockNode must not have children') : invariant(false) : void 0;\n\n newBlocks = updateBlockMapLinks(newBlocks, blockAbove, blockBelow);\n }\n\n return contentState.merge({\n blockMap: newBlocks,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: keyBelow,\n anchorOffset: 0,\n focusKey: keyBelow,\n focusOffset: 0,\n isBackward: false\n })\n });\n};\n\nmodule.exports = splitBlockInContentState;"},{"id":82,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/BlockTree.js","name":"./lib/BlockTree.js","index":30,"index2":28,"size":2353,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","issuerId":2,"issuerName":"./lib/EditorState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"./BlockTree","loc":"21:16-38"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n Repeat = Immutable.Repeat,\n Record = Immutable.Record;\n\n\nvar returnTrue = emptyFunction.thatReturnsTrue;\n\nvar FINGERPRINT_DELIMITER = '-';\n\nvar defaultLeafRange = {\n start: null,\n end: null\n};\n\nvar LeafRange = Record(defaultLeafRange);\n\nvar defaultDecoratorRange = {\n start: null,\n end: null,\n decoratorKey: null,\n leaves: null\n};\n\nvar DecoratorRange = Record(defaultDecoratorRange);\n\nvar BlockTree = {\n /**\n * Generate a block tree for a given ContentBlock/decorator pair.\n */\n generate: function generate(contentState, block, decorator) {\n var textLength = block.getLength();\n if (!textLength) {\n return List.of(new DecoratorRange({\n start: 0,\n end: 0,\n decoratorKey: null,\n leaves: List.of(new LeafRange({ start: 0, end: 0 }))\n }));\n }\n\n var leafSets = [];\n var decorations = decorator ? decorator.getDecorations(block, contentState) : List(Repeat(null, textLength));\n\n var chars = block.getCharacterList();\n\n findRangesImmutable(decorations, areEqual, returnTrue, function (start, end) {\n leafSets.push(new DecoratorRange({\n start: start,\n end: end,\n decoratorKey: decorations.get(start),\n leaves: generateLeaves(chars.slice(start, end).toList(), start)\n }));\n });\n\n return List(leafSets);\n }\n};\n\n/**\n * Generate LeafRange records for a given character list.\n */\nfunction generateLeaves(characters, offset) {\n var leaves = [];\n var inlineStyles = characters.map(function (c) {\n return c.getStyle();\n }).toList();\n findRangesImmutable(inlineStyles, areEqual, returnTrue, function (start, end) {\n leaves.push(new LeafRange({\n start: start + offset,\n end: end + offset\n }));\n });\n return List(leaves);\n}\n\nfunction areEqual(a, b) {\n return a === b;\n}\n\nmodule.exports = BlockTree;"},{"id":83,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorBidiService.js","name":"./lib/EditorBidiService.js","index":37,"index2":38,"size":1185,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","issuerId":2,"issuerName":"./lib/EditorState.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":2,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorState.js","module":"./lib/EditorState.js","moduleName":"./lib/EditorState.js","type":"cjs require","userRequest":"./EditorBidiService","loc":"23:24-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\nvar UnicodeBidiService = require('fbjs/lib/UnicodeBidiService');\n\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar bidiService = void 0;\n\nvar EditorBidiService = {\n getDirectionMap: function getDirectionMap(content, prevBidiMap) {\n if (!bidiService) {\n bidiService = new UnicodeBidiService();\n } else {\n bidiService.reset();\n }\n\n var blockMap = content.getBlockMap();\n var nextBidi = blockMap.valueSeq().map(function (block) {\n return nullthrows(bidiService).getDirection(block.getText());\n });\n var bidiMap = OrderedMap(blockMap.keySeq().zip(nextBidi));\n\n if (prevBidiMap != null && Immutable.is(prevBidiMap, bidiMap)) {\n return prevBidiMap;\n }\n\n return bidiMap;\n }\n};\n\nmodule.exports = EditorBidiService;"},{"id":84,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UnicodeBidiService.js","name":"./node_modules/fbjs/lib/UnicodeBidiService.js","index":38,"index2":36,"size":2700,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorBidiService.js","issuerId":83,"issuerName":"./lib/EditorBidiService.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":83,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/EditorBidiService.js","module":"./lib/EditorBidiService.js","moduleName":"./lib/EditorBidiService.js","type":"cjs require","userRequest":"fbjs/lib/UnicodeBidiService","loc":"16:25-63"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n * \n */\n\n/**\n * Stateful API for text direction detection\n *\n * This class can be used in applications where you need to detect the\n * direction of a sequence of text blocks, where each direction shall be used\n * as the fallback direction for the next one.\n *\n * NOTE: A default direction, if not provided, is set based on the global\n * direction, as defined by `UnicodeBidiDirection`.\n *\n * == Example ==\n * ```\n * var UnicodeBidiService = require('UnicodeBidiService');\n *\n * var bidiService = new UnicodeBidiService();\n *\n * ...\n *\n * bidiService.reset();\n * for (var para in paragraphs) {\n * var dir = bidiService.getDirection(para);\n * ...\n * }\n * ```\n *\n * Part of our implementation of Unicode Bidirectional Algorithm (UBA)\n * Unicode Standard Annex #9 (UAX9)\n * http://www.unicode.org/reports/tr9/\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar UnicodeBidi = require('./UnicodeBidi');\nvar UnicodeBidiDirection = require('./UnicodeBidiDirection');\n\nvar invariant = require('./invariant');\n\nvar UnicodeBidiService = function () {\n\n /**\n * Stateful class for paragraph direction detection\n *\n * @param defaultDir Default direction of the service\n */\n function UnicodeBidiService(defaultDir) {\n _classCallCheck(this, UnicodeBidiService);\n\n if (!defaultDir) {\n defaultDir = UnicodeBidiDirection.getGlobalDir();\n } else {\n !UnicodeBidiDirection.isStrong(defaultDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Default direction must be a strong direction (LTR or RTL)') : invariant(false) : void 0;\n }\n this._defaultDir = defaultDir;\n this.reset();\n }\n\n /**\n * Reset the internal state\n *\n * Instead of creating a new instance, you can just reset() your instance\n * everytime you start a new loop.\n */\n\n\n UnicodeBidiService.prototype.reset = function reset() {\n this._lastDir = this._defaultDir;\n };\n\n /**\n * Returns the direction of a block of text, and remembers it as the\n * fall-back direction for the next paragraph.\n *\n * @param str A text block, e.g. paragraph, table cell, tag\n * @return The resolved direction\n */\n\n\n UnicodeBidiService.prototype.getDirection = function getDirection(str) {\n this._lastDir = UnicodeBidi.getDirection(str, this._lastDir);\n return this._lastDir;\n };\n\n return UnicodeBidiService;\n}();\n\nmodule.exports = UnicodeBidiService;"},{"id":85,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/moveBlockInContentState.js","name":"./lib/moveBlockInContentState.js","index":42,"index2":40,"size":6970,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","issuerId":70,"issuerName":"./lib/AtomicBlockUtils.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":70,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/AtomicBlockUtils.js","module":"./lib/AtomicBlockUtils.js","moduleName":"./lib/AtomicBlockUtils.js","type":"cjs require","userRequest":"./moveBlockInContentState","loc":"30:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar getNextDelimiterBlockKey = require('./getNextDelimiterBlockKey');\nvar invariant = require('fbjs/lib/invariant');\n\nvar OrderedMap = Immutable.OrderedMap,\n List = Immutable.List;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlockToBeMoved, originalTargetBlock, insertionMode, isExperimentalTreeBlock) {\n if (!isExperimentalTreeBlock) {\n return blockMap;\n }\n // possible values of 'insertionMode' are: 'after', 'before'\n var isInsertedAfterTarget = insertionMode === 'after';\n\n var originalBlockKey = originalBlockToBeMoved.getKey();\n var originalTargetKey = originalTargetBlock.getKey();\n var originalParentKey = originalBlockToBeMoved.getParentKey();\n var originalNextSiblingKey = originalBlockToBeMoved.getNextSiblingKey();\n var originalPrevSiblingKey = originalBlockToBeMoved.getPrevSiblingKey();\n var newParentKey = originalTargetBlock.getParentKey();\n var newNextSiblingKey = isInsertedAfterTarget ? originalTargetBlock.getNextSiblingKey() : originalTargetKey;\n var newPrevSiblingKey = isInsertedAfterTarget ? originalTargetKey : originalTargetBlock.getPrevSiblingKey();\n\n return blockMap.withMutations(function (blocks) {\n // update old parent\n transformBlock(originalParentKey, blocks, function (block) {\n var parentChildrenList = block.getChildKeys();\n return block.merge({\n children: parentChildrenList['delete'](parentChildrenList.indexOf(originalBlockKey))\n });\n });\n\n // update old prev\n transformBlock(originalPrevSiblingKey, blocks, function (block) {\n return block.merge({\n nextSibling: originalNextSiblingKey\n });\n });\n\n // update old next\n transformBlock(originalNextSiblingKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalPrevSiblingKey\n });\n });\n\n // update new next\n transformBlock(newNextSiblingKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalBlockKey\n });\n });\n\n // update new prev\n transformBlock(newPrevSiblingKey, blocks, function (block) {\n return block.merge({\n nextSibling: originalBlockKey\n });\n });\n\n // update new parent\n transformBlock(newParentKey, blocks, function (block) {\n var newParentChildrenList = block.getChildKeys();\n var targetBlockIndex = newParentChildrenList.indexOf(originalTargetKey);\n\n var insertionIndex = isInsertedAfterTarget ? targetBlockIndex + 1 : targetBlockIndex !== 0 ? targetBlockIndex - 1 : 0;\n\n var newChildrenArray = newParentChildrenList.toArray();\n newChildrenArray.splice(insertionIndex, 0, originalBlockKey);\n\n return block.merge({\n children: List(newChildrenArray)\n });\n });\n\n // update block\n transformBlock(originalBlockKey, blocks, function (block) {\n return block.merge({\n nextSibling: newNextSiblingKey,\n prevSibling: newPrevSiblingKey,\n parent: newParentKey\n });\n });\n });\n};\n\nvar moveBlockInContentState = function moveBlockInContentState(contentState, blockToBeMoved, targetBlock, insertionMode) {\n !(insertionMode !== 'replace') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Replacing blocks is not supported.') : invariant(false) : void 0;\n\n var targetKey = targetBlock.getKey();\n var blockKey = blockToBeMoved.getKey();\n\n !(blockKey !== targetKey) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n var blockMap = contentState.getBlockMap();\n var isExperimentalTreeBlock = blockToBeMoved instanceof ContentBlockNode;\n\n var blocksToBeMoved = [blockToBeMoved];\n var blockMapWithoutBlocksToBeMoved = blockMap['delete'](blockKey);\n\n if (isExperimentalTreeBlock) {\n blocksToBeMoved = [];\n blockMapWithoutBlocksToBeMoved = blockMap.withMutations(function (blocks) {\n var nextSiblingKey = blockToBeMoved.getNextSiblingKey();\n var nextDelimiterBlockKey = getNextDelimiterBlockKey(blockToBeMoved, blocks);\n\n blocks.toSeq().skipUntil(function (block) {\n return block.getKey() === blockKey;\n }).takeWhile(function (block) {\n var key = block.getKey();\n var isBlockToBeMoved = key === blockKey;\n var hasNextSiblingAndIsNotNextSibling = nextSiblingKey && key !== nextSiblingKey;\n var doesNotHaveNextSiblingAndIsNotDelimiter = !nextSiblingKey && block.getParentKey() && (!nextDelimiterBlockKey || key !== nextDelimiterBlockKey);\n\n return !!(isBlockToBeMoved || hasNextSiblingAndIsNotNextSibling || doesNotHaveNextSiblingAndIsNotDelimiter);\n }).forEach(function (block) {\n blocksToBeMoved.push(block);\n blocks['delete'](block.getKey());\n });\n });\n }\n\n var blocksBefore = blockMapWithoutBlocksToBeMoved.toSeq().takeUntil(function (v) {\n return v === targetBlock;\n });\n\n var blocksAfter = blockMapWithoutBlocksToBeMoved.toSeq().skipUntil(function (v) {\n return v === targetBlock;\n }).skip(1);\n\n var slicedBlocks = blocksToBeMoved.map(function (block) {\n return [block.getKey(), block];\n });\n\n var newBlocks = OrderedMap();\n\n if (insertionMode === 'before') {\n var blockBefore = contentState.getBlockBefore(targetKey);\n\n !(!blockBefore || blockBefore.getKey() !== blockToBeMoved.getKey()) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n newBlocks = blocksBefore.concat([].concat(slicedBlocks, [[targetKey, targetBlock]]), blocksAfter).toOrderedMap();\n } else if (insertionMode === 'after') {\n var blockAfter = contentState.getBlockAfter(targetKey);\n\n !(!blockAfter || blockAfter.getKey() !== blockKey) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n newBlocks = blocksBefore.concat([[targetKey, targetBlock]].concat(slicedBlocks), blocksAfter).toOrderedMap();\n }\n\n return contentState.merge({\n blockMap: updateBlockMapLinks(newBlocks, blockToBeMoved, targetBlock, insertionMode, isExperimentalTreeBlock),\n selectionBefore: contentState.getSelectionAfter(),\n selectionAfter: contentState.getSelectionAfter().merge({\n anchorKey: blockKey,\n focusKey: blockKey\n })\n });\n};\n\nmodule.exports = moveBlockInContentState;"},{"id":86,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/CompositeDraftDecorator.js","name":"./lib/CompositeDraftDecorator.js","index":43,"index2":42,"size":3754,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./CompositeDraftDecorator","loc":"18:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Immutable = require('immutable');\n\nvar List = Immutable.List;\n\n\nvar DELIMITER = '.';\n\n/**\n * A CompositeDraftDecorator traverses through a list of DraftDecorator\n * instances to identify sections of a ContentBlock that should be rendered\n * in a \"decorated\" manner. For example, hashtags, mentions, and links may\n * be intended to stand out visually, be rendered as anchors, etc.\n *\n * The list of decorators supplied to the constructor will be used in the\n * order they are provided. This allows the caller to specify a priority for\n * string matching, in case of match collisions among decorators.\n *\n * For instance, I may have a link with a `#` in its text. Though this section\n * of text may match our hashtag decorator, it should not be treated as a\n * hashtag. I should therefore list my link DraftDecorator\n * before my hashtag DraftDecorator when constructing this composite\n * decorator instance.\n *\n * Thus, when a collision like this is encountered, the earlier match is\n * preserved and the new match is discarded.\n */\n\nvar CompositeDraftDecorator = function () {\n function CompositeDraftDecorator(decorators) {\n _classCallCheck(this, CompositeDraftDecorator);\n\n // Copy the decorator array, since we use this array order to determine\n // precedence of decoration matching. If the array is mutated externally,\n // we don't want to be affected here.\n this._decorators = decorators.slice();\n }\n\n CompositeDraftDecorator.prototype.getDecorations = function getDecorations(block, contentState) {\n var decorations = Array(block.getText().length).fill(null);\n\n this._decorators.forEach(function ( /*object*/decorator, /*number*/ii) {\n var counter = 0;\n var strategy = decorator.strategy;\n var callback = function callback( /*number*/start, /*number*/end) {\n // Find out if any of our matching range is already occupied\n // by another decorator. If so, discard the match. Otherwise, store\n // the component key for rendering.\n if (canOccupySlice(decorations, start, end)) {\n occupySlice(decorations, start, end, ii + DELIMITER + counter);\n counter++;\n }\n };\n strategy(block, callback, contentState);\n });\n\n return List(decorations);\n };\n\n CompositeDraftDecorator.prototype.getComponentForKey = function getComponentForKey(key) {\n var componentKey = parseInt(key.split(DELIMITER)[0], 10);\n return this._decorators[componentKey].component;\n };\n\n CompositeDraftDecorator.prototype.getPropsForKey = function getPropsForKey(key) {\n var componentKey = parseInt(key.split(DELIMITER)[0], 10);\n return this._decorators[componentKey].props;\n };\n\n return CompositeDraftDecorator;\n}();\n\n/**\n * Determine whether we can occupy the specified slice of the decorations\n * array.\n */\n\n\nfunction canOccupySlice(decorations, start, end) {\n for (var ii = start; ii < end; ii++) {\n if (decorations[ii] != null) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Splice the specified component into our decoration array at the desired\n * range.\n */\nfunction occupySlice(targetArr, start, end, componentKey) {\n for (var ii = start; ii < end; ii++) {\n targetArr[ii] = componentKey;\n }\n}\n\nmodule.exports = CompositeDraftDecorator;"},{"id":87,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","name":"./lib/DraftEditor.react.js","index":48,"index2":147,"size":21024,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","issuerId":69,"issuerName":"./lib/Draft.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":69,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/Draft.js","module":"./lib/Draft.js","moduleName":"./lib/Draft.js","type":"cjs require","userRequest":"./DraftEditor.react","loc":"23:18-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":1,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n * @preventMunge\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DefaultDraftInlineStyle = require('./DefaultDraftInlineStyle');\nvar DraftEditorCompositionHandler = require('./DraftEditorCompositionHandler');\nvar DraftEditorContents = require('./DraftEditorContents.react');\nvar DraftEditorDragHandler = require('./DraftEditorDragHandler');\nvar DraftEditorEditHandler = require('./DraftEditorEditHandler');\nvar DraftEditorPlaceholder = require('./DraftEditorPlaceholder.react');\nvar DraftODS = require('./DraftODS');\nvar EditorState = require('./EditorState');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar Scroll = require('fbjs/lib/Scroll');\nvar Style = require('fbjs/lib/Style');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar cx = require('fbjs/lib/cx');\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar generateRandomKey = require('./generateRandomKey');\nvar getDefaultKeyBinding = require('./getDefaultKeyBinding');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\nvar gkx = require('./gkx');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar isIE = UserAgent.isBrowser('IE');\n\n// IE does not support the `input` event on contentEditable, so we can't\n// observe spellcheck behavior.\nvar allowSpellCheck = !isIE;\n\n// Define a set of handler objects to correspond to each possible `mode`\n// of editor behavior.\nvar handlerMap = {\n edit: DraftEditorEditHandler,\n composite: DraftEditorCompositionHandler,\n drag: DraftEditorDragHandler,\n cut: null,\n render: null\n};\n\nvar didInitODS = false;\n\nvar UpdateDraftEditorFlags = function (_React$Component) {\n _inherits(UpdateDraftEditorFlags, _React$Component);\n\n function UpdateDraftEditorFlags() {\n _classCallCheck(this, UpdateDraftEditorFlags);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n UpdateDraftEditorFlags.prototype.render = function render() {\n return null;\n };\n\n UpdateDraftEditorFlags.prototype.componentDidMount = function componentDidMount() {\n this._update();\n };\n\n UpdateDraftEditorFlags.prototype.componentDidUpdate = function componentDidUpdate() {\n this._update();\n };\n\n UpdateDraftEditorFlags.prototype._update = function _update() {\n var editor = this.props.editor;\n /**\n * Sometimes a render triggers a 'focus' or other event, and that will\n * schedule a second render pass.\n * In order to make sure the second render pass gets the latest editor\n * state, we update it here.\n * Example:\n * render #1\n * +\n * |\n * | cWU -> Nothing ... latestEditorState = STALE_STATE :(\n * |\n * | render -> this.props.editorState = FRESH_STATE\n * | + *and* set latestEditorState = FRESH_STATE\n * |\n * | |\n * | +--> triggers 'focus' event, calling 'handleFocus' with latestEditorState\n * | +\n * | |\n * +>cdU -> latestEditorState = FRESH_STATE | the 'handleFocus' call schedules render #2\n * | with latestEditorState, which is FRESH_STATE\n * |\n * render #2 <--------------------------------------+\n * +\n * |\n * | cwU -> nothing updates\n * |\n * | render -> this.props.editorState = FRESH_STATE which was passed in above\n * |\n * +>cdU fires and resets latestEditorState = FRESH_STATE\n * ---\n * Note that if we don't set latestEditorState in 'render' in the above\n * diagram, then STALE_STATE gets passed to render #2.\n */\n editor._latestEditorState = this.props.editorState;\n\n /**\n * The reason we set this 'blockSelectEvents' flag is that IE will fire a\n * 'selectionChange' event when we programmatically change the selection,\n * meaning it would trigger a new select event while we are in the middle\n * of updating.\n * We found that the 'selection.addRange' was what triggered the stray\n * selectionchange event in IE.\n * To be clear - we have not been able to reproduce specific bugs related\n * to this stray selection event, but have recorded logs that some\n * conditions do cause it to get bumped into during editOnSelect.\n */\n editor._blockSelectEvents = true;\n };\n\n return UpdateDraftEditorFlags;\n}(React.Component);\n\n/**\n * `DraftEditor` is the root editor component. It composes a `contentEditable`\n * div, and provides a wide variety of useful function props for managing the\n * state of the editor. See `DraftEditorProps` for details.\n */\n\n\nvar DraftEditor = function (_React$Component2) {\n _inherits(DraftEditor, _React$Component2);\n\n function DraftEditor(props) {\n _classCallCheck(this, DraftEditor);\n\n var _this2 = _possibleConstructorReturn(this, _React$Component2.call(this, props));\n\n _this2.focus = function (scrollPosition) {\n var editorState = _this2.props.editorState;\n\n var alreadyHasFocus = editorState.getSelection().getHasFocus();\n var editorNode = ReactDOM.findDOMNode(_this2.editor);\n\n if (!editorNode) {\n // once in a while people call 'focus' in a setTimeout, and the node has\n // been deleted, so it can be null in that case.\n return;\n }\n\n var scrollParent = Style.getScrollParent(editorNode);\n\n var _ref = scrollPosition || getScrollPosition(scrollParent),\n x = _ref.x,\n y = _ref.y;\n\n !(editorNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'editorNode is not an HTMLElement') : invariant(false) : void 0;\n\n editorNode.focus();\n\n // Restore scroll position\n if (scrollParent === window) {\n window.scrollTo(x, y);\n } else {\n Scroll.setTop(scrollParent, y);\n }\n\n // On Chrome and Safari, calling focus on contenteditable focuses the\n // cursor at the first character. This is something you don't expect when\n // you're clicking on an input element but not directly on a character.\n // Put the cursor back where it was before the blur.\n if (!alreadyHasFocus) {\n _this2.update(EditorState.forceSelection(editorState, editorState.getSelection()));\n }\n };\n\n _this2.blur = function () {\n var editorNode = ReactDOM.findDOMNode(_this2.editor);\n !(editorNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'editorNode is not an HTMLElement') : invariant(false) : void 0;\n editorNode.blur();\n };\n\n _this2.setMode = function (mode) {\n _this2._handler = handlerMap[mode];\n };\n\n _this2.exitCurrentMode = function () {\n _this2.setMode('edit');\n };\n\n _this2.restoreEditorDOM = function (scrollPosition) {\n _this2.setState({ contentsKey: _this2.state.contentsKey + 1 }, function () {\n _this2.focus(scrollPosition);\n });\n };\n\n _this2.setClipboard = function (clipboard) {\n _this2._clipboard = clipboard;\n };\n\n _this2.getClipboard = function () {\n return _this2._clipboard;\n };\n\n _this2.update = function (editorState) {\n _this2._latestEditorState = editorState;\n _this2.props.onChange(editorState);\n };\n\n _this2.onDragEnter = function () {\n _this2._dragCount++;\n };\n\n _this2.onDragLeave = function () {\n _this2._dragCount--;\n if (_this2._dragCount === 0) {\n _this2.exitCurrentMode();\n }\n };\n\n _this2._blockSelectEvents = false;\n _this2._clipboard = null;\n _this2._handler = null;\n _this2._dragCount = 0;\n _this2._editorKey = props.editorKey || generateRandomKey();\n _this2._placeholderAccessibilityID = 'placeholder-' + _this2._editorKey;\n _this2._latestEditorState = props.editorState;\n _this2._latestCommittedEditorState = props.editorState;\n\n _this2._onBeforeInput = _this2._buildHandler('onBeforeInput');\n _this2._onBlur = _this2._buildHandler('onBlur');\n _this2._onCharacterData = _this2._buildHandler('onCharacterData');\n _this2._onCompositionEnd = _this2._buildHandler('onCompositionEnd');\n _this2._onCompositionStart = _this2._buildHandler('onCompositionStart');\n _this2._onCopy = _this2._buildHandler('onCopy');\n _this2._onCut = _this2._buildHandler('onCut');\n _this2._onDragEnd = _this2._buildHandler('onDragEnd');\n _this2._onDragOver = _this2._buildHandler('onDragOver');\n _this2._onDragStart = _this2._buildHandler('onDragStart');\n _this2._onDrop = _this2._buildHandler('onDrop');\n _this2._onInput = _this2._buildHandler('onInput');\n _this2._onFocus = _this2._buildHandler('onFocus');\n _this2._onKeyDown = _this2._buildHandler('onKeyDown');\n _this2._onKeyPress = _this2._buildHandler('onKeyPress');\n _this2._onKeyUp = _this2._buildHandler('onKeyUp');\n _this2._onMouseDown = _this2._buildHandler('onMouseDown');\n _this2._onMouseUp = _this2._buildHandler('onMouseUp');\n _this2._onPaste = _this2._buildHandler('onPaste');\n _this2._onSelect = _this2._buildHandler('onSelect');\n\n _this2.getEditorKey = function () {\n return _this2._editorKey;\n };\n\n if (process.env.NODE_ENV !== 'production') {\n ['onDownArrow', 'onEscape', 'onLeftArrow', 'onRightArrow', 'onTab', 'onUpArrow'].forEach(function (propName) {\n if (props.hasOwnProperty(propName)) {\n // eslint-disable-next-line no-console\n console.warn('Supplying an `' + propName + '` prop to `DraftEditor` has ' + 'been deprecated. If your handler needs access to the keyboard ' + 'event, supply a custom `keyBindingFn` prop that falls back to ' + 'the default one (eg. https://is.gd/RG31RJ).');\n }\n });\n }\n\n // See `restoreEditorDOM()`.\n _this2.state = { contentsKey: 0 };\n return _this2;\n }\n\n /**\n * Build a method that will pass the event to the specified handler method.\n * This allows us to look up the correct handler function for the current\n * editor mode, if any has been specified.\n */\n\n\n /**\n * Define proxies that can route events to the current handler.\n */\n\n\n DraftEditor.prototype._buildHandler = function _buildHandler(eventName) {\n var _this3 = this;\n\n var flushControlled = ReactDOM.unstable_flushControlled;\n // Wrap event handlers in `flushControlled`. In sync mode, this is\n // effetively a no-op. In async mode, this ensures all updates scheduled\n // inside the handler are flushed before React yields to the browser.\n return function (e) {\n if (!_this3.props.readOnly) {\n var method = _this3._handler && _this3._handler[eventName];\n if (method) {\n if (flushControlled) {\n flushControlled(function () {\n return method(_this3, e);\n });\n } else {\n method(_this3, e);\n }\n }\n }\n };\n };\n\n DraftEditor.prototype._showPlaceholder = function _showPlaceholder() {\n return !!this.props.placeholder && !this.props.editorState.isInCompositionMode() && !this.props.editorState.getCurrentContent().hasText();\n };\n\n DraftEditor.prototype._renderPlaceholder = function _renderPlaceholder() {\n if (this._showPlaceholder()) {\n var placeHolderProps = {\n text: nullthrows(this.props.placeholder),\n editorState: this.props.editorState,\n textAlignment: this.props.textAlignment,\n accessibilityID: this._placeholderAccessibilityID\n };\n\n return React.createElement(DraftEditorPlaceholder, placeHolderProps);\n }\n return null;\n };\n\n DraftEditor.prototype.render = function render() {\n var _this4 = this;\n\n var _props = this.props,\n blockRenderMap = _props.blockRenderMap,\n blockRendererFn = _props.blockRendererFn,\n blockStyleFn = _props.blockStyleFn,\n customStyleFn = _props.customStyleFn,\n customStyleMap = _props.customStyleMap,\n editorState = _props.editorState,\n readOnly = _props.readOnly,\n textAlignment = _props.textAlignment,\n textDirectionality = _props.textDirectionality;\n\n\n var rootClass = cx({\n 'DraftEditor/root': true,\n 'DraftEditor/alignLeft': textAlignment === 'left',\n 'DraftEditor/alignRight': textAlignment === 'right',\n 'DraftEditor/alignCenter': textAlignment === 'center'\n });\n\n var contentStyle = {\n outline: 'none',\n // fix parent-draggable Safari bug. #1326\n userSelect: 'text',\n WebkitUserSelect: 'text',\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word'\n };\n\n // The aria-expanded and aria-haspopup properties should only be rendered\n // for a combobox.\n /* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error\n * found when Flow v0.68 was deployed. To see the error delete this comment\n * and run Flow. */\n var ariaRole = this.props.role || 'textbox';\n var ariaExpanded = ariaRole === 'combobox' ? !!this.props.ariaExpanded : null;\n\n var editorContentsProps = {\n blockRenderMap: blockRenderMap,\n blockRendererFn: blockRendererFn,\n blockStyleFn: blockStyleFn,\n customStyleMap: _extends({}, DefaultDraftInlineStyle, customStyleMap),\n customStyleFn: customStyleFn,\n editorKey: this._editorKey,\n editorState: editorState,\n key: 'contents' + this.state.contentsKey,\n textDirectionality: textDirectionality\n };\n\n return React.createElement(\n 'div',\n { className: rootClass },\n this._renderPlaceholder(),\n React.createElement(\n 'div',\n {\n className: cx('DraftEditor/editorContainer'),\n ref: function ref(_ref3) {\n return _this4.editorContainer = _ref3;\n } },\n React.createElement(\n 'div',\n {\n 'aria-activedescendant': readOnly ? null : this.props.ariaActiveDescendantID,\n 'aria-autocomplete': readOnly ? null : this.props.ariaAutoComplete,\n 'aria-controls': readOnly ? null : this.props.ariaControls,\n 'aria-describedby': this.props.ariaDescribedBy || this._placeholderAccessibilityID,\n 'aria-expanded': readOnly ? null : ariaExpanded,\n 'aria-label': this.props.ariaLabel,\n 'aria-labelledby': this.props.ariaLabelledBy,\n 'aria-multiline': this.props.ariaMultiline,\n autoCapitalize: this.props.autoCapitalize,\n autoComplete: this.props.autoComplete,\n autoCorrect: this.props.autoCorrect,\n className: cx({\n // Chrome's built-in translation feature mutates the DOM in ways\n // that Draft doesn't expect (ex: adding tags inside\n // DraftEditorLeaf spans) and causes problems. We add notranslate\n // here which makes its autotranslation skip over this subtree.\n notranslate: !readOnly,\n 'public/DraftEditor/content': true\n }),\n contentEditable: !readOnly,\n 'data-testid': this.props.webDriverTestID,\n onBeforeInput: this._onBeforeInput,\n onBlur: this._onBlur,\n onCompositionEnd: this._onCompositionEnd,\n onCompositionStart: this._onCompositionStart,\n onCopy: this._onCopy,\n onCut: this._onCut,\n onDragEnd: this._onDragEnd,\n onDragEnter: this.onDragEnter,\n onDragLeave: this.onDragLeave,\n onDragOver: this._onDragOver,\n onDragStart: this._onDragStart,\n onDrop: this._onDrop,\n onFocus: this._onFocus,\n onInput: this._onInput,\n onKeyDown: this._onKeyDown,\n onKeyPress: this._onKeyPress,\n onKeyUp: this._onKeyUp,\n onMouseUp: this._onMouseUp,\n onPaste: this._onPaste,\n onSelect: this._onSelect,\n ref: function ref(_ref2) {\n return _this4.editor = _ref2;\n },\n role: readOnly ? null : ariaRole,\n spellCheck: allowSpellCheck && this.props.spellCheck,\n style: contentStyle,\n suppressContentEditableWarning: true,\n tabIndex: this.props.tabIndex },\n React.createElement(UpdateDraftEditorFlags, { editor: this, editorState: editorState }),\n React.createElement(DraftEditorContents, editorContentsProps)\n )\n )\n );\n };\n\n DraftEditor.prototype.componentDidMount = function componentDidMount() {\n if (!didInitODS && gkx('draft_ods_enabled')) {\n didInitODS = true;\n DraftODS.init();\n }\n this.setMode('edit');\n\n /**\n * IE has a hardcoded \"feature\" that attempts to convert link text into\n * anchors in contentEditable DOM. This breaks the editor's expectations of\n * the DOM, and control is lost. Disable it to make IE behave.\n * See: http://blogs.msdn.com/b/ieinternals/archive/2010/09/15/\n * ie9-beta-minor-change-list.aspx\n */\n if (isIE) {\n document.execCommand('AutoUrlDetect', false, false);\n }\n };\n\n DraftEditor.prototype.componentDidUpdate = function componentDidUpdate() {\n this._blockSelectEvents = false;\n // moving this here, when it was previously set in componentWillUpdate\n this._latestEditorState = this.props.editorState;\n this._latestCommittedEditorState = this.props.editorState;\n };\n\n /**\n * Used via `this.focus()`.\n *\n * Force focus back onto the editor node.\n *\n * We attempt to preserve scroll position when focusing. You can also pass\n * a specified scroll position (for cases like `cut` behavior where it should\n * be restored to a known position).\n */\n\n\n /**\n * Used via `this.setMode(...)`.\n *\n * Set the behavior mode for the editor component. This switches the current\n * handler module to ensure that DOM events are managed appropriately for\n * the active mode.\n */\n\n\n /**\n * Used via `this.restoreEditorDOM()`.\n *\n * Force a complete re-render of the DraftEditorContents based on the current\n * EditorState. This is useful when we know we are going to lose control of\n * the DOM state (cut command, IME) and we want to make sure that\n * reconciliation occurs on a version of the DOM that is synchronized with\n * our EditorState.\n */\n\n\n /**\n * Used via `this.setClipboard(...)`.\n *\n * Set the clipboard state for a cut/copy event.\n */\n\n\n /**\n * Used via `this.getClipboard()`.\n *\n * Retrieve the clipboard state for a cut/copy event.\n */\n\n\n /**\n * Used via `this.update(...)`.\n *\n * Propagate a new `EditorState` object to higher-level components. This is\n * the method by which event handlers inform the `DraftEditor` component of\n * state changes. A component that composes a `DraftEditor` **must** provide\n * an `onChange` prop to receive state updates passed along from this\n * function.\n */\n\n\n /**\n * Used in conjunction with `onDragLeave()`, by counting the number of times\n * a dragged element enters and leaves the editor (or any of its children),\n * to determine when the dragged element absolutely leaves the editor.\n */\n\n\n /**\n * See `onDragEnter()`.\n */\n\n\n return DraftEditor;\n}(React.Component);\n\nDraftEditor.defaultProps = {\n blockRenderMap: DefaultDraftBlockRenderMap,\n blockRendererFn: emptyFunction.thatReturnsNull,\n blockStyleFn: emptyFunction.thatReturns(''),\n keyBindingFn: getDefaultKeyBinding,\n readOnly: false,\n spellCheck: false,\n stripPastedStyles: false\n};\n\n\nmodule.exports = DraftEditor;"},{"id":88,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorCompositionHandler.js","name":"./lib/DraftEditorCompositionHandler.js","index":49,"index2":51,"size":6333,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DraftEditorCompositionHandler","loc":"28:36-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar Keys = require('fbjs/lib/Keys');\n\nvar getEntityKeyForSelection = require('./getEntityKeyForSelection');\nvar gkx = require('./gkx');\nvar isEventHandled = require('./isEventHandled');\nvar isSelectionAtLeafStart = require('./isSelectionAtLeafStart');\n\n/**\n * Millisecond delay to allow `compositionstart` to fire again upon\n * `compositionend`.\n *\n * This is used for Korean input to ensure that typing can continue without\n * the editor trying to render too quickly. More specifically, Safari 7.1+\n * triggers `compositionstart` a little slower than Chrome/FF, which\n * leads to composed characters being resolved and re-render occurring\n * sooner than we want.\n */\nvar RESOLVE_DELAY = 20;\n\n/**\n * A handful of variables used to track the current composition and its\n * resolution status. These exist at the module level because it is not\n * possible to have compositions occurring in multiple editors simultaneously,\n * and it simplifies state management with respect to the DraftEditor component.\n */\nvar resolved = false;\nvar stillComposing = false;\nvar textInputData = '';\n\nvar DraftEditorCompositionHandler = {\n onBeforeInput: function onBeforeInput(editor, e) {\n textInputData = (textInputData || '') + e.data;\n },\n\n /**\n * A `compositionstart` event has fired while we're still in composition\n * mode. Continue the current composition session to prevent a re-render.\n */\n onCompositionStart: function onCompositionStart(editor) {\n stillComposing = true;\n },\n\n /**\n * Attempt to end the current composition session.\n *\n * Defer handling because browser will still insert the chars into active\n * element after `compositionend`. If a `compositionstart` event fires\n * before `resolveComposition` executes, our composition session will\n * continue.\n *\n * The `resolved` flag is useful because certain IME interfaces fire the\n * `compositionend` event multiple times, thus queueing up multiple attempts\n * at handling the composition. Since handling the same composition event\n * twice could break the DOM, we only use the first event. Example: Arabic\n * Google Input Tools on Windows 8.1 fires `compositionend` three times.\n */\n onCompositionEnd: function onCompositionEnd(editor, e) {\n resolved = false;\n stillComposing = false;\n setTimeout(function () {\n if (!resolved) {\n DraftEditorCompositionHandler.resolveComposition(editor, e);\n }\n }, RESOLVE_DELAY);\n },\n\n /**\n * In Safari, keydown events may fire when committing compositions. If\n * the arrow keys are used to commit, prevent default so that the cursor\n * doesn't move, otherwise it will jump back noticeably on re-render.\n */\n onKeyDown: function onKeyDown(editor, e) {\n if (!stillComposing) {\n // If a keydown event is received after compositionend but before the\n // 20ms timer expires (ex: type option-E then backspace, or type A then\n // backspace in 2-Set Korean), we should immediately resolve the\n // composition and reinterpret the key press in edit mode.\n DraftEditorCompositionHandler.resolveComposition(editor, e);\n editor._onKeyDown(e);\n return;\n }\n if (e.which === Keys.RIGHT || e.which === Keys.LEFT) {\n e.preventDefault();\n }\n },\n\n /**\n * Keypress events may fire when committing compositions. In Firefox,\n * pressing RETURN commits the composition and inserts extra newline\n * characters that we do not want. `preventDefault` allows the composition\n * to be committed while preventing the extra characters.\n */\n onKeyPress: function onKeyPress(editor, e) {\n if (e.which === Keys.RETURN) {\n e.preventDefault();\n }\n },\n\n /**\n * Attempt to insert composed characters into the document.\n *\n * If we are still in a composition session, do nothing. Otherwise, insert\n * the characters into the document and terminate the composition session.\n *\n * If no characters were composed -- for instance, the user\n * deleted all composed characters and committed nothing new --\n * force a re-render. We also re-render when the composition occurs\n * at the beginning of a leaf, to ensure that if the browser has\n * created a new text node for the composition, we will discard it.\n *\n * Resetting innerHTML will move focus to the beginning of the editor,\n * so we update to force it back to the correct place.\n */\n resolveComposition: function resolveComposition(editor, event) {\n if (stillComposing) {\n return;\n }\n\n resolved = true;\n var composedChars = textInputData;\n textInputData = '';\n\n var editorState = EditorState.set(editor._latestEditorState, {\n inCompositionMode: false\n });\n\n var currentStyle = editorState.getCurrentInlineStyle();\n var entityKey = getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection());\n\n var mustReset = !composedChars || isSelectionAtLeafStart(editorState) || currentStyle.size > 0 || entityKey !== null;\n\n if (mustReset) {\n editor.restoreEditorDOM();\n }\n\n editor.exitCurrentMode();\n\n if (composedChars) {\n if (gkx('draft_handlebeforeinput_composed_text') && editor.props.handleBeforeInput && isEventHandled(editor.props.handleBeforeInput(composedChars, editorState, event.timeStamp))) {\n return;\n }\n // If characters have been composed, re-rendering with the update\n // is sufficient to reset the editor.\n var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), composedChars, currentStyle, entityKey);\n editor.update(EditorState.push(editorState, contentState, 'insert-characters'));\n return;\n }\n\n if (mustReset) {\n editor.update(EditorState.set(editorState, {\n nativelyRenderedContent: null,\n forceSelection: true\n }));\n }\n }\n};\n\nmodule.exports = DraftEditorCompositionHandler;"},{"id":89,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","name":"./lib/DraftEditorContents.react.js","index":54,"index2":88,"size":579,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DraftEditorContents.react","loc":"29:26-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar gkx = require('./gkx');\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\n\nmodule.exports = experimentalTreeDataSupport ? require('./DraftEditorContentsExperimental.react') : require('./DraftEditorContents-core.react');"},{"id":90,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","name":"./lib/DraftEditorContentsExperimental.react.js","index":55,"index2":84,"size":7381,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","issuerId":89,"issuerName":"./lib/DraftEditorContents.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":89,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","module":"./lib/DraftEditorContents.react.js","moduleName":"./lib/DraftEditorContents.react.js","type":"cjs require","userRequest":"./DraftEditorContentsExperimental.react","loc":"19:47-97"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This file is a fork of DraftEditorContents.react.js for tree nodes\n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorBlockNode = require('./DraftEditorBlockNode.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar EditorState = require('./EditorState');\nvar React = require('react');\n\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * `DraftEditorContents` is the container component for all block components\n * rendered for a `DraftEditor`. It is optimized to aggressively avoid\n * re-rendering blocks whenever possible.\n *\n * This component is separate from `DraftEditor` because certain props\n * (for instance, ARIA props) must be allowed to update without affecting\n * the contents of the editor.\n */\nvar DraftEditorContentsExperimental = function (_React$Component) {\n _inherits(DraftEditorContentsExperimental, _React$Component);\n\n function DraftEditorContentsExperimental() {\n _classCallCheck(this, DraftEditorContentsExperimental);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorContentsExperimental.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var prevEditorState = this.props.editorState;\n var nextEditorState = nextProps.editorState;\n\n var prevDirectionMap = prevEditorState.getDirectionMap();\n var nextDirectionMap = nextEditorState.getDirectionMap();\n\n // Text direction has changed for one or more blocks. We must re-render.\n if (prevDirectionMap !== nextDirectionMap) {\n return true;\n }\n\n var didHaveFocus = prevEditorState.getSelection().getHasFocus();\n var nowHasFocus = nextEditorState.getSelection().getHasFocus();\n\n if (didHaveFocus !== nowHasFocus) {\n return true;\n }\n\n var nextNativeContent = nextEditorState.getNativelyRenderedContent();\n\n var wasComposing = prevEditorState.isInCompositionMode();\n var nowComposing = nextEditorState.isInCompositionMode();\n\n // If the state is unchanged or we're currently rendering a natively\n // rendered state, there's nothing new to be done.\n if (prevEditorState === nextEditorState || nextNativeContent !== null && nextEditorState.getCurrentContent() === nextNativeContent || wasComposing && nowComposing) {\n return false;\n }\n\n var prevContent = prevEditorState.getCurrentContent();\n var nextContent = nextEditorState.getCurrentContent();\n var prevDecorator = prevEditorState.getDecorator();\n var nextDecorator = nextEditorState.getDecorator();\n return wasComposing !== nowComposing || prevContent !== nextContent || prevDecorator !== nextDecorator || nextEditorState.mustForceSelection();\n };\n\n DraftEditorContentsExperimental.prototype.render = function render() {\n var _props = this.props,\n blockRenderMap = _props.blockRenderMap,\n blockRendererFn = _props.blockRendererFn,\n blockStyleFn = _props.blockStyleFn,\n customStyleMap = _props.customStyleMap,\n customStyleFn = _props.customStyleFn,\n editorState = _props.editorState,\n editorKey = _props.editorKey,\n textDirectionality = _props.textDirectionality;\n\n\n var content = editorState.getCurrentContent();\n var selection = editorState.getSelection();\n var forceSelection = editorState.mustForceSelection();\n var decorator = editorState.getDecorator();\n var directionMap = nullthrows(editorState.getDirectionMap());\n\n var blocksAsArray = content.getBlocksAsArray();\n var rootBlock = blocksAsArray[0];\n var processedBlocks = [];\n\n var nodeBlock = rootBlock;\n\n while (nodeBlock) {\n var blockKey = nodeBlock.getKey();\n var blockProps = {\n blockRenderMap: blockRenderMap,\n blockRendererFn: blockRendererFn,\n blockStyleFn: blockStyleFn,\n contentState: content,\n customStyleFn: customStyleFn,\n customStyleMap: customStyleMap,\n decorator: decorator,\n editorKey: editorKey,\n editorState: editorState,\n forceSelection: forceSelection,\n selection: selection,\n block: nodeBlock,\n direction: textDirectionality ? textDirectionality : directionMap.get(blockKey),\n tree: editorState.getBlockTree(blockKey)\n };\n\n var configForType = blockRenderMap.get(nodeBlock.getType()) || blockRenderMap.get('unstyled');\n var wrapperTemplate = configForType.wrapper;\n processedBlocks.push({\n block: React.createElement(DraftEditorBlockNode, _extends({ key: blockKey }, blockProps)),\n wrapperTemplate: wrapperTemplate,\n key: blockKey,\n offsetKey: DraftOffsetKey.encode(blockKey, 0, 0)\n });\n\n var nextBlockKey = nodeBlock.getNextSiblingKey();\n nodeBlock = nextBlockKey ? content.getBlockForKey(nextBlockKey) : null;\n }\n\n // Group contiguous runs of blocks that have the same wrapperTemplate\n var outputBlocks = [];\n for (var ii = 0; ii < processedBlocks.length;) {\n var info = processedBlocks[ii];\n if (info.wrapperTemplate) {\n var blocks = [];\n do {\n blocks.push(processedBlocks[ii].block);\n ii++;\n } while (ii < processedBlocks.length && processedBlocks[ii].wrapperTemplate === info.wrapperTemplate);\n var wrapperElement = React.cloneElement(info.wrapperTemplate, {\n key: info.key + '-wrap',\n 'data-offset-key': info.offsetKey\n }, blocks);\n outputBlocks.push(wrapperElement);\n } else {\n outputBlocks.push(info.block);\n ii++;\n }\n }\n\n return React.createElement(\n 'div',\n { 'data-contents': 'true' },\n outputBlocks\n );\n };\n\n return DraftEditorContentsExperimental;\n}(React.Component);\n\nmodule.exports = DraftEditorContentsExperimental;"},{"id":91,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","name":"./lib/DraftEditorBlockNode.react.js","index":56,"index2":83,"size":12192,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","issuerId":90,"issuerName":"./lib/DraftEditorContentsExperimental.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":90,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContentsExperimental.react.js","module":"./lib/DraftEditorContentsExperimental.react.js","moduleName":"./lib/DraftEditorContentsExperimental.react.js","type":"cjs require","userRequest":"./DraftEditorBlockNode.react","loc":"30:27-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This file is a fork of DraftEditorBlock.react.js and DraftEditorContents.react.js\n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorNode = require('./DraftEditorNode.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar EditorState = require('./EditorState');\nvar Immutable = require('immutable');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar Scroll = require('fbjs/lib/Scroll');\nvar Style = require('fbjs/lib/Style');\n\nvar getElementPosition = require('fbjs/lib/getElementPosition');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\nvar getViewportDimensions = require('fbjs/lib/getViewportDimensions');\nvar invariant = require('fbjs/lib/invariant');\n\nvar SCROLL_BUFFER = 10;\n\nvar List = Immutable.List;\n\n// we should harden up the bellow flow types to make them more strict\n\n/**\n * Return whether a block overlaps with either edge of the `SelectionState`.\n */\nvar isBlockOnSelectionEdge = function isBlockOnSelectionEdge(selection, key) {\n return selection.getAnchorKey() === key || selection.getFocusKey() === key;\n};\n\n/**\n * We will use this helper to identify blocks that need to be wrapped but have siblings that\n * also share the same wrapper element, this way we can do the wrapping once the last sibling\n * is added.\n */\nvar shouldNotAddWrapperElement = function shouldNotAddWrapperElement(block, contentState) {\n var nextSiblingKey = block.getNextSiblingKey();\n\n return nextSiblingKey ? contentState.getBlockForKey(nextSiblingKey).getType() === block.getType() : false;\n};\n\nvar applyWrapperElementToSiblings = function applyWrapperElementToSiblings(wrapperTemplate, Element, nodes) {\n var wrappedSiblings = [];\n\n // we check back until we find a sibbling that does not have same wrapper\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = nodes.reverse()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var sibling = _step.value;\n\n if (sibling.type !== Element) {\n break;\n }\n wrappedSiblings.push(sibling);\n }\n\n // we now should remove from acc the wrappedSiblings and add them back under same wrap\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator['return']) {\n _iterator['return']();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n nodes.splice(nodes.indexOf(wrappedSiblings[0]), wrappedSiblings.length + 1);\n\n var childrenIs = wrappedSiblings.reverse();\n\n var key = childrenIs[0].key;\n\n nodes.push(React.cloneElement(wrapperTemplate, {\n key: key + '-wrap',\n 'data-offset-key': DraftOffsetKey.encode(key, 0, 0)\n }, childrenIs));\n\n return nodes;\n};\n\nvar getDraftRenderConfig = function getDraftRenderConfig(block, blockRenderMap) {\n var configForType = blockRenderMap.get(block.getType()) || blockRenderMap.get('unstyled');\n\n var wrapperTemplate = configForType.wrapper;\n var Element = configForType.element || blockRenderMap.get('unstyled').element;\n\n return {\n Element: Element,\n wrapperTemplate: wrapperTemplate\n };\n};\n\nvar getCustomRenderConfig = function getCustomRenderConfig(block, blockRendererFn) {\n var customRenderer = blockRendererFn(block);\n\n if (!customRenderer) {\n return {};\n }\n\n var CustomComponent = customRenderer.component,\n customProps = customRenderer.props,\n customEditable = customRenderer.editable;\n\n\n return {\n CustomComponent: CustomComponent,\n customProps: customProps,\n customEditable: customEditable\n };\n};\n\nvar getElementPropsConfig = function getElementPropsConfig(block, editorKey, offsetKey, blockStyleFn, customConfig) {\n var elementProps = {\n 'data-block': true,\n 'data-editor': editorKey,\n 'data-offset-key': offsetKey,\n key: block.getKey()\n };\n var customClass = blockStyleFn(block);\n\n if (customClass) {\n elementProps.className = customClass;\n }\n\n if (customConfig.customEditable !== undefined) {\n elementProps = _extends({}, elementProps, {\n contentEditable: customConfig.customEditable,\n suppressContentEditableWarning: true\n });\n }\n\n return elementProps;\n};\n\nvar DraftEditorBlockNode = function (_React$Component) {\n _inherits(DraftEditorBlockNode, _React$Component);\n\n function DraftEditorBlockNode() {\n _classCallCheck(this, DraftEditorBlockNode);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorBlockNode.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var _props = this.props,\n block = _props.block,\n direction = _props.direction,\n tree = _props.tree;\n\n var isContainerNode = !block.getChildKeys().isEmpty();\n var blockHasChanged = block !== nextProps.block || tree !== nextProps.tree || direction !== nextProps.direction || isBlockOnSelectionEdge(nextProps.selection, nextProps.block.getKey()) && nextProps.forceSelection;\n\n // if we have children at this stage we always re-render container nodes\n // else if its a root node we avoid re-rendering by checking for block updates\n return isContainerNode || blockHasChanged;\n };\n\n /**\n * When a block is mounted and overlaps the selection state, we need to make\n * sure that the cursor is visible to match native behavior. This may not\n * be the case if the user has pressed `RETURN` or pasted some content, since\n * programatically creating these new blocks and setting the DOM selection\n * will miss out on the browser natively scrolling to that position.\n *\n * To replicate native behavior, if the block overlaps the selection state\n * on mount, force the scroll position. Check the scroll state of the scroll\n * parent, and adjust it to align the entire block to the bottom of the\n * scroll parent.\n */\n\n\n DraftEditorBlockNode.prototype.componentDidMount = function componentDidMount() {\n var selection = this.props.selection;\n var endKey = selection.getEndKey();\n if (!selection.getHasFocus() || endKey !== this.props.block.getKey()) {\n return;\n }\n\n var blockNode = ReactDOM.findDOMNode(this);\n var scrollParent = Style.getScrollParent(blockNode);\n var scrollPosition = getScrollPosition(scrollParent);\n var scrollDelta = void 0;\n\n if (scrollParent === window) {\n var nodePosition = getElementPosition(blockNode);\n var nodeBottom = nodePosition.y + nodePosition.height;\n var viewportHeight = getViewportDimensions().height;\n scrollDelta = nodeBottom - viewportHeight;\n if (scrollDelta > 0) {\n window.scrollTo(scrollPosition.x, scrollPosition.y + scrollDelta + SCROLL_BUFFER);\n }\n } else {\n !(blockNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'blockNode is not an HTMLElement') : invariant(false) : void 0;\n var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;\n var scrollBottom = scrollParent.offsetHeight + scrollPosition.y;\n scrollDelta = blockBottom - scrollBottom;\n if (scrollDelta > 0) {\n Scroll.setTop(scrollParent, Scroll.getTop(scrollParent) + scrollDelta + SCROLL_BUFFER);\n }\n }\n };\n\n DraftEditorBlockNode.prototype.render = function render() {\n var _this2 = this;\n\n var _props2 = this.props,\n block = _props2.block,\n blockRenderMap = _props2.blockRenderMap,\n blockRendererFn = _props2.blockRendererFn,\n blockStyleFn = _props2.blockStyleFn,\n contentState = _props2.contentState,\n decorator = _props2.decorator,\n editorKey = _props2.editorKey,\n editorState = _props2.editorState,\n customStyleFn = _props2.customStyleFn,\n customStyleMap = _props2.customStyleMap,\n direction = _props2.direction,\n forceSelection = _props2.forceSelection,\n selection = _props2.selection,\n tree = _props2.tree;\n\n\n var children = null;\n\n if (block.children.size) {\n children = block.children.reduce(function (acc, key) {\n var offsetKey = DraftOffsetKey.encode(key, 0, 0);\n var child = contentState.getBlockForKey(key);\n var customConfig = getCustomRenderConfig(child, blockRendererFn);\n var Component = customConfig.CustomComponent || DraftEditorBlockNode;\n\n var _getDraftRenderConfig = getDraftRenderConfig(child, blockRenderMap),\n Element = _getDraftRenderConfig.Element,\n wrapperTemplate = _getDraftRenderConfig.wrapperTemplate;\n\n var elementProps = getElementPropsConfig(child, editorKey, offsetKey, blockStyleFn, customConfig);\n var childProps = _extends({}, _this2.props, {\n tree: editorState.getBlockTree(key),\n blockProps: customConfig.customProps,\n offsetKey: offsetKey,\n block: child\n });\n\n acc.push(React.createElement(Element, elementProps, React.createElement(Component, childProps)));\n\n if (!wrapperTemplate || shouldNotAddWrapperElement(child, contentState)) {\n return acc;\n }\n\n // if we are here it means we are the last block\n // that has a wrapperTemplate so we should wrap itself\n // and all other previous siblings that share the same wrapper\n applyWrapperElementToSiblings(wrapperTemplate, Element, acc);\n\n return acc;\n }, []);\n }\n\n var blockKey = block.getKey();\n var offsetKey = DraftOffsetKey.encode(blockKey, 0, 0);\n\n var blockNode = React.createElement(DraftEditorNode, {\n block: block,\n children: children,\n contentState: contentState,\n customStyleFn: customStyleFn,\n customStyleMap: customStyleMap,\n decorator: decorator,\n direction: direction,\n forceSelection: forceSelection,\n hasSelection: isBlockOnSelectionEdge(selection, blockKey),\n selection: selection,\n tree: tree\n });\n\n if (block.getParentKey()) {\n return blockNode;\n }\n\n var _getDraftRenderConfig2 = getDraftRenderConfig(block, blockRenderMap),\n Element = _getDraftRenderConfig2.Element;\n\n var elementProps = getElementPropsConfig(block, editorKey, offsetKey, blockStyleFn, getCustomRenderConfig(block, blockRendererFn));\n\n // root block nodes needs to be wrapped\n return React.createElement(Element, elementProps, blockNode);\n };\n\n return DraftEditorBlockNode;\n}(React.Component);\n\nmodule.exports = DraftEditorBlockNode;"},{"id":92,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","name":"./lib/DraftEditorNode.react.js","index":57,"index2":71,"size":4375,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","issuerId":91,"issuerName":"./lib/DraftEditorBlockNode.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":91,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorBlockNode.react.js","module":"./lib/DraftEditorBlockNode.react.js","moduleName":"./lib/DraftEditorBlockNode.react.js","type":"cjs require","userRequest":"./DraftEditorNode.react","loc":"30:22-56"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorDecoratedLeaves = require('./DraftEditorDecoratedLeaves.react');\nvar DraftEditorLeaf = require('./DraftEditorLeaf.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar Immutable = require('immutable');\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\n\nvar List = Immutable.List;\n\nvar DraftEditorNode = function (_React$Component) {\n _inherits(DraftEditorNode, _React$Component);\n\n function DraftEditorNode() {\n _classCallCheck(this, DraftEditorNode);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorNode.prototype.render = function render() {\n var _props = this.props,\n block = _props.block,\n contentState = _props.contentState,\n customStyleFn = _props.customStyleFn,\n customStyleMap = _props.customStyleMap,\n decorator = _props.decorator,\n direction = _props.direction,\n forceSelection = _props.forceSelection,\n hasSelection = _props.hasSelection,\n selection = _props.selection,\n tree = _props.tree;\n\n\n var blockKey = block.getKey();\n var text = block.getText();\n var lastLeafSet = tree.size - 1;\n\n var children = this.props.children || tree.map(function (leafSet, ii) {\n var decoratorKey = leafSet.get('decoratorKey');\n var leavesForLeafSet = leafSet.get('leaves');\n var lastLeaf = leavesForLeafSet.size - 1;\n var Leaves = leavesForLeafSet.map(function (leaf, jj) {\n var offsetKey = DraftOffsetKey.encode(blockKey, ii, jj);\n var start = leaf.get('start');\n var end = leaf.get('end');\n return React.createElement(DraftEditorLeaf, {\n key: offsetKey,\n offsetKey: offsetKey,\n block: block,\n start: start,\n selection: hasSelection ? selection : null,\n forceSelection: forceSelection,\n text: text.slice(start, end),\n styleSet: block.getInlineStyleAt(start),\n customStyleMap: customStyleMap,\n customStyleFn: customStyleFn,\n isLast: decoratorKey === lastLeafSet && jj === lastLeaf\n });\n }).toArray();\n\n if (!decoratorKey || !decorator) {\n return Leaves;\n }\n\n return React.createElement(DraftEditorDecoratedLeaves, {\n block: block,\n children: Leaves,\n contentState: contentState,\n decorator: decorator,\n decoratorKey: decoratorKey,\n direction: direction,\n leafSet: leafSet,\n text: text,\n key: ii\n });\n }).toArray();\n\n return React.createElement(\n 'div',\n {\n 'data-offset-key': DraftOffsetKey.encode(blockKey, 0, 0),\n className: cx({\n 'public/DraftStyleDefault/block': true,\n 'public/DraftStyleDefault/ltr': direction === 'LTR',\n 'public/DraftStyleDefault/rtl': direction === 'RTL'\n }) },\n children\n );\n };\n\n return DraftEditorNode;\n}(React.Component);\n\nmodule.exports = DraftEditorNode;"},{"id":93,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDecoratedLeaves.react.js","name":"./lib/DraftEditorDecoratedLeaves.react.js","index":58,"index2":53,"size":3725,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","issuerId":92,"issuerName":"./lib/DraftEditorNode.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":92,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorNode.react.js","module":"./lib/DraftEditorNode.react.js","moduleName":"./lib/DraftEditorNode.react.js","type":"cjs require","userRequest":"./DraftEditorDecoratedLeaves.react","loc":"24:33-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":6,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar React = require('react');\nvar UnicodeBidi = require('fbjs/lib/UnicodeBidi');\nvar UnicodeBidiDirection = require('fbjs/lib/UnicodeBidiDirection');\n\nvar DraftEditorDecoratedLeaves = function (_React$Component) {\n _inherits(DraftEditorDecoratedLeaves, _React$Component);\n\n function DraftEditorDecoratedLeaves() {\n _classCallCheck(this, DraftEditorDecoratedLeaves);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorDecoratedLeaves.prototype.render = function render() {\n var _props = this.props,\n block = _props.block,\n children = _props.children,\n contentState = _props.contentState,\n decorator = _props.decorator,\n decoratorKey = _props.decoratorKey,\n direction = _props.direction,\n leafSet = _props.leafSet,\n text = _props.text;\n\n\n var blockKey = block.getKey();\n var leavesForLeafSet = leafSet.get('leaves');\n var DecoratorComponent = decorator.getComponentForKey(decoratorKey);\n var decoratorProps = decorator.getPropsForKey(decoratorKey);\n var decoratorOffsetKey = DraftOffsetKey.encode(blockKey, parseInt(decoratorKey, 10), 0);\n\n var decoratedText = text.slice(leavesForLeafSet.first().get('start'), leavesForLeafSet.last().get('end'));\n\n // Resetting dir to the same value on a child node makes Chrome/Firefox\n // confused on cursor movement. See http://jsfiddle.net/d157kLck/3/\n var dir = UnicodeBidiDirection.getHTMLDirIfDifferent(UnicodeBidi.getDirection(decoratedText), direction);\n\n return React.createElement(\n DecoratorComponent,\n _extends({}, decoratorProps, {\n contentState: contentState,\n decoratedText: decoratedText,\n dir: dir,\n key: decoratorOffsetKey,\n entityKey: block.getEntityAt(leafSet.get('start')),\n offsetKey: decoratorOffsetKey }),\n children\n );\n };\n\n return DraftEditorDecoratedLeaves;\n}(React.Component);\n\nmodule.exports = DraftEditorDecoratedLeaves;"},{"id":94,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorTextNode.react.js","name":"./lib/DraftEditorTextNode.react.js","index":61,"index2":62,"size":4597,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","issuerId":48,"issuerName":"./lib/DraftEditorLeaf.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"./DraftEditorTextNode.react","loc":"23:26-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\n// In IE, spans with
tags render as two newlines. By rendering a span\n// with only a newline character, we can be sure to render a single line.\nvar useNewlineChar = UserAgent.isBrowser('IE <= 11');\n\n/**\n * Check whether the node should be considered a newline.\n */\nfunction isNewline(node) {\n return useNewlineChar ? node.textContent === '\\n' : node.tagName === 'BR';\n}\n\n/**\n * Placeholder elements for empty text content.\n *\n * What is this `data-text` attribute, anyway? It turns out that we need to\n * put an attribute on the lowest-level text node in order to preserve correct\n * spellcheck handling. If the is naked, Chrome and Safari may do\n * bizarre things to do the DOM -- split text nodes, create extra spans, etc.\n * If the has an attribute, this appears not to happen.\n * See http://jsfiddle.net/9khdavod/ for the failure case, and\n * http://jsfiddle.net/7pg143f7/ for the fixed case.\n */\nvar NEWLINE_A = useNewlineChar ? React.createElement(\n 'span',\n { key: 'A', 'data-text': 'true' },\n '\\n'\n) : React.createElement('br', { key: 'A', 'data-text': 'true' });\n\nvar NEWLINE_B = useNewlineChar ? React.createElement(\n 'span',\n { key: 'B', 'data-text': 'true' },\n '\\n'\n) : React.createElement('br', { key: 'B', 'data-text': 'true' });\n\n/**\n * The lowest-level component in a `DraftEditor`, the text node component\n * replaces the default React text node implementation. This allows us to\n * perform custom handling of newline behavior and avoid re-rendering text\n * nodes with DOM state that already matches the expectations of our immutable\n * editor state.\n */\nvar DraftEditorTextNode = function (_React$Component) {\n _inherits(DraftEditorTextNode, _React$Component);\n\n function DraftEditorTextNode(props) {\n _classCallCheck(this, DraftEditorTextNode);\n\n // By flipping this flag, we also keep flipping keys which forces\n // React to remount this node every time it rerenders.\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this._forceFlag = false;\n return _this;\n }\n\n DraftEditorTextNode.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var node = ReactDOM.findDOMNode(this);\n var shouldBeNewline = nextProps.children === '';\n !(node instanceof Element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'node is not an Element') : invariant(false) : void 0;\n if (shouldBeNewline) {\n return !isNewline(node);\n }\n return node.textContent !== nextProps.children;\n };\n\n DraftEditorTextNode.prototype.componentDidMount = function componentDidMount() {\n this._forceFlag = !this._forceFlag;\n };\n\n DraftEditorTextNode.prototype.componentDidUpdate = function componentDidUpdate() {\n this._forceFlag = !this._forceFlag;\n };\n\n DraftEditorTextNode.prototype.render = function render() {\n if (this.props.children === '') {\n return this._forceFlag ? NEWLINE_A : NEWLINE_B;\n }\n return React.createElement(\n 'span',\n { key: this._forceFlag ? 'A' : 'B', 'data-text': 'true' },\n this.props.children\n );\n };\n\n return DraftEditorTextNode;\n}(React.Component);\n\nmodule.exports = DraftEditorTextNode;"},{"id":95,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgentData.js","name":"./node_modules/fbjs/lib/UserAgentData.js","index":64,"index2":57,"size":2344,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","issuerId":11,"issuerName":"./node_modules/fbjs/lib/UserAgent.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":11,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","module":"./node_modules/fbjs/lib/UserAgent.js","moduleName":"./node_modules/fbjs/lib/UserAgent.js","type":"cjs require","userRequest":"./UserAgentData","loc":"11:20-46"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Usage note:\n * This module makes a best effort to export the same data we would internally.\n * At Facebook we use a server-generated module that does the parsing and\n * exports the data for the client to use. We can't rely on a server-side\n * implementation in open source so instead we make use of an open source\n * library to do the heavy lifting and then make some adjustments as necessary.\n * It's likely there will be some differences. Some we can smooth over.\n * Others are going to be harder.\n */\n\n'use strict';\n\nvar UAParser = require('ua-parser-js');\n\nvar UNKNOWN = 'Unknown';\n\nvar PLATFORM_MAP = {\n 'Mac OS': 'Mac OS X'\n};\n\n/**\n * Convert from UAParser platform name to what we expect.\n */\nfunction convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}\n\n/**\n * Get the version number in parts. This is very naive. We actually get major\n * version as a part of UAParser already, which is generally good enough, but\n * let's get the minor just in case.\n */\nfunction getBrowserVersion(version) {\n if (!version) {\n return {\n major: '',\n minor: ''\n };\n }\n var parts = version.split('.');\n return {\n major: parts[0],\n minor: parts[1]\n };\n}\n\n/**\n * Get the UA data fom UAParser and then convert it to the format we're\n * expecting for our APIS.\n */\nvar parser = new UAParser();\nvar results = parser.getResult();\n\n// Do some conversion first.\nvar browserVersionData = getBrowserVersion(results.browser.version);\nvar uaData = {\n browserArchitecture: results.cpu.architecture || UNKNOWN,\n browserFullVersion: results.browser.version || UNKNOWN,\n browserMinorVersion: browserVersionData.minor || UNKNOWN,\n browserName: results.browser.name || UNKNOWN,\n browserVersion: results.browser.major || UNKNOWN,\n deviceName: results.device.model || UNKNOWN,\n engineName: results.engine.name || UNKNOWN,\n engineVersion: results.engine.version || UNKNOWN,\n platformArchitecture: results.cpu.architecture || UNKNOWN,\n platformName: convertPlatformName(results.os.name) || UNKNOWN,\n platformVersion: results.os.version || UNKNOWN,\n platformFullVersion: results.os.version || UNKNOWN\n};\n\nmodule.exports = uaData;"},{"id":96,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/ua-parser-js/src/ua-parser.js","name":"./node_modules/ua-parser-js/src/ua-parser.js","index":65,"index2":56,"size":50016,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgentData.js","issuerId":95,"issuerName":"./node_modules/fbjs/lib/UserAgentData.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":95,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgentData.js","module":"./node_modules/fbjs/lib/UserAgentData.js","moduleName":"./node_modules/fbjs/lib/UserAgentData.js","type":"cjs require","userRequest":"ua-parser-js","loc":"22:15-38"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * UAParser.js v0.7.17\n * Lightweight JavaScript-based User-Agent string parser\n * https://github.com/faisalman/ua-parser-js\n *\n * Copyright © 2012-2016 Faisal Salman \n * Dual licensed under GPLv2 & MIT\n */\n\n(function (window, undefined) {\n\n 'use strict';\n\n //////////////\n // Constants\n /////////////\n\n\n var LIBVERSION = '0.7.17',\n EMPTY = '',\n UNKNOWN = '?',\n FUNC_TYPE = 'function',\n UNDEF_TYPE = 'undefined',\n OBJ_TYPE = 'object',\n STR_TYPE = 'string',\n MAJOR = 'major', // deprecated\n MODEL = 'model',\n NAME = 'name',\n TYPE = 'type',\n VENDOR = 'vendor',\n VERSION = 'version',\n ARCHITECTURE= 'architecture',\n CONSOLE = 'console',\n MOBILE = 'mobile',\n TABLET = 'tablet',\n SMARTTV = 'smarttv',\n WEARABLE = 'wearable',\n EMBEDDED = 'embedded';\n\n\n ///////////\n // Helper\n //////////\n\n\n var util = {\n extend : function (regexes, extensions) {\n var margedRegexes = {};\n for (var i in regexes) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n margedRegexes[i] = extensions[i].concat(regexes[i]);\n } else {\n margedRegexes[i] = regexes[i];\n }\n }\n return margedRegexes;\n },\n has : function (str1, str2) {\n if (typeof str1 === \"string\") {\n return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;\n } else {\n return false;\n }\n },\n lowerize : function (str) {\n return str.toLowerCase();\n },\n major : function (version) {\n return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g,'').split(\".\")[0] : undefined;\n },\n trim : function (str) {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n };\n\n\n ///////////////\n // Map helper\n //////////////\n\n\n var mapper = {\n\n rgx : function (ua, arrays) {\n\n //var result = {},\n var i = 0, j, k, p, q, matches, match;//, args = arguments;\n\n /*// construct object barebones\n for (p = 0; p < args[1].length; p++) {\n q = args[1][p];\n result[typeof q === OBJ_TYPE ? q[0] : q] = undefined;\n }*/\n\n // loop through all regexes maps\n while (i < arrays.length && !matches) {\n\n var regex = arrays[i], // even sequence (0,2,4,..)\n props = arrays[i + 1]; // odd sequence (1,3,5,..)\n j = k = 0;\n\n // try matching uastring with regexes\n while (j < regex.length && !matches) {\n\n matches = regex[j++].exec(ua);\n\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n // check if given property is actually array\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length == 2) {\n if (typeof q[1] == FUNC_TYPE) {\n // assign modified match\n this[q[0]] = q[1].call(this, match);\n } else {\n // assign given value, ignore regex match\n this[q[0]] = q[1];\n }\n } else if (q.length == 3) {\n // check whether function or regex\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n // call function (usually string mapper)\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;\n } else {\n // sanitize match using given regex\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;\n }\n } else if (q.length == 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;\n }\n } else {\n this[q] = match ? match : undefined;\n }\n }\n }\n }\n i += 2;\n }\n // console.log(this);\n //return this;\n },\n\n str : function (str, map) {\n\n for (var i in map) {\n // check if array\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (util.has(map[i][j], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n } else if (util.has(map[i], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n return str;\n }\n };\n\n\n ///////////////\n // String map\n //////////////\n\n\n var maps = {\n\n browser : {\n oldsafari : {\n version : {\n '1.0' : '/8',\n '1.2' : '/1',\n '1.3' : '/3',\n '2.0' : '/412',\n '2.0.2' : '/416',\n '2.0.3' : '/417',\n '2.0.4' : '/419',\n '?' : '/'\n }\n }\n },\n\n device : {\n amazon : {\n model : {\n 'Fire Phone' : ['SD', 'KF']\n }\n },\n sprint : {\n model : {\n 'Evo Shift 4G' : '7373KT'\n },\n vendor : {\n 'HTC' : 'APA',\n 'Sprint' : 'Sprint'\n }\n }\n },\n\n os : {\n windows : {\n version : {\n 'ME' : '4.90',\n 'NT 3.11' : 'NT3.51',\n 'NT 4.0' : 'NT4.0',\n '2000' : 'NT 5.0',\n 'XP' : ['NT 5.1', 'NT 5.2'],\n 'Vista' : 'NT 6.0',\n '7' : 'NT 6.1',\n '8' : 'NT 6.2',\n '8.1' : 'NT 6.3',\n '10' : ['NT 6.4', 'NT 10.0'],\n 'RT' : 'ARM'\n }\n }\n }\n };\n\n\n //////////////\n // Regex map\n /////////////\n\n\n var regexes = {\n\n browser : [[\n\n // Presto based\n /(opera\\smini)\\/([\\w\\.-]+)/i, // Opera Mini\n /(opera\\s[mobiletab]+).+version\\/([\\w\\.-]+)/i, // Opera Mobi/Tablet\n /(opera).+version\\/([\\w\\.]+)/i, // Opera > 9.80\n /(opera)[\\/\\s]+([\\w\\.]+)/i // Opera < 9.80\n ], [NAME, VERSION], [\n\n /(opios)[\\/\\s]+([\\w\\.]+)/i // Opera mini on iphone >= 8.0\n ], [[NAME, 'Opera Mini'], VERSION], [\n\n /\\s(opr)\\/([\\w\\.]+)/i // Opera Webkit\n ], [[NAME, 'Opera'], VERSION], [\n\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/\\s]?([\\w\\.]+)*/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n\n // Trident based\n /(avant\\s|iemobile|slim|baidu)(?:browser)?[\\/\\s]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser/Baidu\n /(?:ms|\\()(ie)\\s([\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based\n /(rekonq)\\/([\\w\\.]+)*/i, // Rekonq\n /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser)\\/([\\w\\.-]+)/i\n // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser\n ], [NAME, VERSION], [\n\n /(trident).+rv[:\\s]([\\w\\.]+).+like\\sgecko/i // IE11\n ], [[NAME, 'IE'], VERSION], [\n\n /(edge)\\/((\\d+)?[\\w\\.]+)/i // Microsoft Edge\n ], [NAME, VERSION], [\n\n /(yabrowser)\\/([\\w\\.]+)/i // Yandex\n ], [[NAME, 'Yandex'], VERSION], [\n\n /(puffin)\\/([\\w\\.]+)/i // Puffin\n ], [[NAME, 'Puffin'], VERSION], [\n\n /((?:[\\s\\/])uc?\\s?browser|(?:juc.+)ucweb)[\\/\\s]?([\\w\\.]+)/i\n // UCBrowser\n ], [[NAME, 'UCBrowser'], VERSION], [\n\n /(comodo_dragon)\\/([\\w\\.]+)/i // Comodo Dragon\n ], [[NAME, /_/g, ' '], VERSION], [\n\n /(micromessenger)\\/([\\w\\.]+)/i // WeChat\n ], [[NAME, 'WeChat'], VERSION], [\n\n /(QQ)\\/([\\d\\.]+)/i // QQ, aka ShouQ\n ], [NAME, VERSION], [\n\n /m?(qqbrowser)[\\/\\s]?([\\w\\.]+)/i // QQBrowser\n ], [NAME, VERSION], [\n\n /xiaomi\\/miuibrowser\\/([\\w\\.]+)/i // MIUI Browser\n ], [VERSION, [NAME, 'MIUI Browser']], [\n\n /;fbav\\/([\\w\\.]+);/i // Facebook App for iOS & Android\n ], [VERSION, [NAME, 'Facebook']], [\n\n /headlesschrome(?:\\/([\\w\\.]+)|\\s)/i // Chrome Headless\n ], [VERSION, [NAME, 'Chrome Headless']], [\n\n /\\swv\\).+(chrome)\\/([\\w\\.]+)/i // Chrome WebView\n ], [[NAME, /(.+)/, '$1 WebView'], VERSION], [\n\n /((?:oculus|samsung)browser)\\/([\\w\\.]+)/i\n ], [[NAME, /(.+(?:g|us))(.+)/, '$1 $2'], VERSION], [ // Oculus / Samsung Browser\n\n /android.+version\\/([\\w\\.]+)\\s+(?:mobile\\s?safari|safari)*/i // Android Browser\n ], [VERSION, [NAME, 'Android Browser']], [\n\n /(chrome|omniweb|arora|[tizenoka]{5}\\s?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ], [NAME, VERSION], [\n\n /(dolfin)\\/([\\w\\.]+)/i // Dolphin\n ], [[NAME, 'Dolphin'], VERSION], [\n\n /((?:android.+)crmo|crios)\\/([\\w\\.]+)/i // Chrome for Android/iOS\n ], [[NAME, 'Chrome'], VERSION], [\n\n /(coast)\\/([\\w\\.]+)/i // Opera Coast\n ], [[NAME, 'Opera Coast'], VERSION], [\n\n /fxios\\/([\\w\\.-]+)/i // Firefox for iOS\n ], [VERSION, [NAME, 'Firefox']], [\n\n /version\\/([\\w\\.]+).+?mobile\\/\\w+\\s(safari)/i // Mobile Safari\n ], [VERSION, [NAME, 'Mobile Safari']], [\n\n /version\\/([\\w\\.]+).+?(mobile\\s?safari|safari)/i // Safari & Safari Mobile\n ], [VERSION, NAME], [\n\n /webkit.+?(gsa)\\/([\\w\\.]+).+?(mobile\\s?safari|safari)(\\/[\\w\\.]+)/i // Google Search Appliance on iOS\n ], [[NAME, 'GSA'], VERSION], [\n\n /webkit.+?(mobile\\s?safari|safari)(\\/[\\w\\.]+)/i // Safari < 3.0\n ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [\n\n /(konqueror)\\/([\\w\\.]+)/i, // Konqueror\n /(webkit|khtml)\\/([\\w\\.]+)/i\n ], [NAME, VERSION], [\n\n // Gecko based\n /(navigator|netscape)\\/([\\w\\.-]+)/i // Netscape\n ], [[NAME, 'Netscape'], VERSION], [\n /(swiftfox)/i, // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo\\sbrowser|minimo|conkeror)[\\/\\s]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror\n /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\\/([\\w\\.-]+)/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(mozilla)\\/([\\w\\.]+).+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\\/\\s]?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir\n /(links)\\s\\(([\\w\\.]+)/i, // Links\n /(gobrowser)\\/?([\\w\\.]+)*/i, // GoBrowser\n /(ice\\s?browser)\\/v?([\\w\\._]+)/i, // ICE Browser\n /(mosaic)[\\/\\s]([\\w\\.]+)/i // Mosaic\n ], [NAME, VERSION]\n\n /* /////////////////////\n // Media players BEGIN\n ////////////////////////\n\n , [\n\n /(apple(?:coremedia|))\\/((\\d+)[\\w\\._]+)/i, // Generic Apple CoreMedia\n /(coremedia) v((\\d+)[\\w\\._]+)/i\n ], [NAME, VERSION], [\n\n /(aqualung|lyssna|bsplayer)\\/((\\d+)?[\\w\\.-]+)/i // Aqualung/Lyssna/BSPlayer\n ], [NAME, VERSION], [\n\n /(ares|ossproxy)\\s((\\d+)[\\w\\.-]+)/i // Ares/OSSProxy\n ], [NAME, VERSION], [\n\n /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\\/((\\d+)[\\w\\.-]+)/i,\n // Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC\n // NSPlayer/PSP-InternetRadioPlayer/Videos\n /(clementine|music player daemon)\\s((\\d+)[\\w\\.-]+)/i, // Clementine/MPD\n /(lg player|nexplayer)\\s((\\d+)[\\d\\.]+)/i,\n /player\\/(nexplayer|lg player)\\s((\\d+)[\\w\\.-]+)/i // NexPlayer/LG Player\n ], [NAME, VERSION], [\n /(nexplayer)\\s((\\d+)[\\w\\.-]+)/i // Nexplayer\n ], [NAME, VERSION], [\n\n /(flrp)\\/((\\d+)[\\w\\.-]+)/i // Flip Player\n ], [[NAME, 'Flip Player'], VERSION], [\n\n /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i\n // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit\n ], [NAME], [\n\n /(gstreamer) souphttpsrc (?:\\([^\\)]+\\)){0,1} libsoup\\/((\\d+)[\\w\\.-]+)/i\n // Gstreamer\n ], [NAME, VERSION], [\n\n /(htc streaming player)\\s[\\w_]+\\s\\/\\s((\\d+)[\\d\\.]+)/i, // HTC Streaming Player\n /(java|python-urllib|python-requests|wget|libcurl)\\/((\\d+)[\\w\\.-_]+)/i,\n // Java/urllib/requests/wget/cURL\n /(lavf)((\\d+)[\\d\\.]+)/i // Lavf (FFMPEG)\n ], [NAME, VERSION], [\n\n /(htc_one_s)\\/((\\d+)[\\d\\.]+)/i // HTC One S\n ], [[NAME, /_/g, ' '], VERSION], [\n\n /(mplayer)(?:\\s|\\/)(?:(?:sherpya-){0,1}svn)(?:-|\\s)(r\\d+(?:-\\d+[\\w\\.-]+){0,1})/i\n // MPlayer SVN\n ], [NAME, VERSION], [\n\n /(mplayer)(?:\\s|\\/|[unkow-]+)((\\d+)[\\w\\.-]+)/i // MPlayer\n ], [NAME, VERSION], [\n\n /(mplayer)/i, // MPlayer (no other info)\n /(yourmuze)/i, // YourMuze\n /(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime\n ], [NAME], [\n\n /(nero (?:home|scout))\\/((\\d+)[\\w\\.-]+)/i // Nero Home/Nero Scout\n ], [NAME, VERSION], [\n\n /(nokia\\d+)\\/((\\d+)[\\w\\.-]+)/i // Nokia\n ], [NAME, VERSION], [\n\n /\\s(songbird)\\/((\\d+)[\\w\\.-]+)/i // Songbird/Philips-Songbird\n ], [NAME, VERSION], [\n\n /(winamp)3 version ((\\d+)[\\w\\.-]+)/i, // Winamp\n /(winamp)\\s((\\d+)[\\w\\.-]+)/i,\n /(winamp)mpeg\\/((\\d+)[\\w\\.-]+)/i\n ], [NAME, VERSION], [\n\n /(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)\n // inlight radio\n ], [NAME], [\n\n /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\\/((\\d+)[\\w\\.-]+)/i\n // QuickTime/RealMedia/RadioApp/RadioClientApplication/\n // SoundTap/Totem/Stagefright/Streamium\n ], [NAME, VERSION], [\n\n /(smp)((\\d+)[\\d\\.]+)/i // SMP\n ], [NAME, VERSION], [\n\n /(vlc) media player - version ((\\d+)[\\w\\.]+)/i, // VLC Videolan\n /(vlc)\\/((\\d+)[\\w\\.-]+)/i,\n /(xbmc|gvfs|xine|xmms|irapp)\\/((\\d+)[\\w\\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp\n /(foobar2000)\\/((\\d+)[\\d\\.]+)/i, // Foobar2000\n /(itunes)\\/((\\d+)[\\d\\.]+)/i // iTunes\n ], [NAME, VERSION], [\n\n /(wmplayer)\\/((\\d+)[\\w\\.-]+)/i, // Windows Media Player\n /(windows-media-player)\\/((\\d+)[\\w\\.-]+)/i\n ], [[NAME, /-/g, ' '], VERSION], [\n\n /windows\\/((\\d+)[\\w\\.-]+) upnp\\/[\\d\\.]+ dlnadoc\\/[\\d\\.]+ (home media server)/i\n // Windows Media Server\n ], [VERSION, [NAME, 'Windows']], [\n\n /(com\\.riseupradioalarm)\\/((\\d+)[\\d\\.]*)/i // RiseUP Radio Alarm\n ], [NAME, VERSION], [\n\n /(rad.io)\\s((\\d+)[\\d\\.]+)/i, // Rad.io\n /(radio.(?:de|at|fr))\\s((\\d+)[\\d\\.]+)/i\n ], [[NAME, 'rad.io'], VERSION]\n\n //////////////////////\n // Media players END\n ////////////////////*/\n\n ],\n\n cpu : [[\n\n /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\\)]/i // AMD64\n ], [[ARCHITECTURE, 'amd64']], [\n\n /(ia32(?=;))/i // IA32 (quicktime)\n ], [[ARCHITECTURE, util.lowerize]], [\n\n /((?:i[346]|x)86)[;\\)]/i // IA32\n ], [[ARCHITECTURE, 'ia32']], [\n\n // PocketPC mistakenly identified as PowerPC\n /windows\\s(ce|mobile);\\sppc;/i\n ], [[ARCHITECTURE, 'arm']], [\n\n /((?:ppc|powerpc)(?:64)?)(?:\\smac|;|\\))/i // PowerPC\n ], [[ARCHITECTURE, /ower/, '', util.lowerize]], [\n\n /(sun4\\w)[;\\)]/i // SPARC\n ], [[ARCHITECTURE, 'sparc']], [\n\n /((?:avr32|ia64(?=;))|68k(?=\\))|arm(?:64|(?=v\\d+;))|(?=atmel\\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ], [[ARCHITECTURE, util.lowerize]]\n ],\n\n device : [[\n\n /\\((ipad|playbook);[\\w\\s\\);-]+(rim|apple)/i // iPad/PlayBook\n ], [MODEL, VENDOR, [TYPE, TABLET]], [\n\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/ // iPad\n ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [\n\n /(apple\\s{0,1}tv)/i // Apple TV\n ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [\n\n /(archos)\\s(gamepad2?)/i, // Archos\n /(hp).+(touchpad)/i, // HP TouchPad\n /(hp).+(tablet)/i, // HP Tablet\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /\\s(nook)[\\w\\s]+build\\/(\\w+)/i, // Nook\n /(dell)\\s(strea[kpr\\s\\d]*[\\dko])/i // Dell Streak\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(kf[A-z]+)\\sbuild\\/[\\w\\.]+.*silk\\//i // Kindle Fire HD\n ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [\n /(sd|kf)[0349hijorstuw]+\\sbuild\\/[\\w\\.]+.*silk\\//i // Fire Phone\n ], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [\n\n /\\((ip[honed|\\s\\w*]+);.+(apple)/i // iPod/iPhone\n ], [MODEL, VENDOR, [TYPE, MOBILE]], [\n /\\((ip[honed|\\s\\w*]+);/i // iPod/iPhone\n ], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [\n\n /(blackberry)[\\s-]?(\\w+)/i, // BlackBerry\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\\s_-]?([\\w-]+)*/i,\n // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp)\\s([\\w\\s]+\\w)/i, // HP iPAQ\n /(asus)-?(\\w+)/i // Asus\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /\\(bb10;\\s(\\w+)/i // BlackBerry 10\n ], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [\n // Asus Tablets\n /android.+(transfo[prime\\s]{4,10}\\s\\w+|eeepc|slider\\s\\w+|nexus 7|padfone)/i\n ], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [\n\n /(sony)\\s(tablet\\s[ps])\\sbuild\\//i, // Sony\n /(sony)?(?:sgp.+)\\sbuild\\//i\n ], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [\n /android.+\\s([c-g]\\d{4}|so[-l]\\w+)\\sbuild\\//i\n ], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [\n\n /\\s(ouya)\\s/i, // Ouya\n /(nintendo)\\s([wids3u]+)/i // Nintendo\n ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n\n /android.+;\\s(shield)\\sbuild/i // Nvidia\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n\n /(playstation\\s[34portablevi]+)/i // Playstation\n ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [\n\n /(sprint\\s(\\w+))/i // Sprint Phones\n ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [\n\n /(lenovo)\\s?(S(?:5000|6000)+(?:[-][\\w+]))/i // Lenovo tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(htc)[;_\\s-]+([\\w\\s]+(?=\\))|\\w+)*/i, // HTC\n /(zte)-(\\w+)*/i, // ZTE\n /(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\\s)sony)[_\\s-]?([\\w-]+)*/i\n // Alcatel/GeeksPhone/Lenovo/Nexian/Panasonic/Sony\n ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n /(nexus\\s9)/i // HTC Nexus 9\n ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n\n /d\\/huawei([\\w\\s-]+)[;\\)]/i,\n /(nexus\\s6p)/i // Huawei\n ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [\n\n /(microsoft);\\s(lumia[\\s\\w]+)/i // Microsoft Lumia\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /[\\s\\(;](xbox(?:\\sone)?)[\\s\\);]/i // Microsoft Xbox\n ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [\n /(kin\\.[onetw]{3})/i // Microsoft Kin\n ], [[MODEL, /\\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [\n\n // Motorola\n /\\s(milestone|droid(?:[2-4x]|\\s(?:bionic|x2|pro|razr))?(:?\\s4g)?)[\\w\\s]+build\\//i,\n /mot[\\s-]?(\\w+)*/i,\n /(XT\\d{3,4}) build\\//i,\n /(nexus\\s6)/i\n ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [\n /android.+\\s(mz60\\d|xoom[\\s2]{0,2})\\sbuild\\//i\n ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [\n\n /hbbtv\\/\\d+\\.\\d+\\.\\d+\\s+\\([\\w\\s]*;\\s*(\\w[^;]*);([^;]*)/i // HbbTV devices\n ], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [\n\n /hbbtv.+maple;(\\d+)/i\n ], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [\n\n /\\(dtv[\\);].+(aquos)/i // Sharp\n ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [\n\n /android.+((sch-i[89]0\\d|shw-m380s|gt-p\\d{4}|gt-n\\d+|sgh-t8[56]9|nexus 10))/i,\n /((SM-T\\w+))/i\n ], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung\n /smart-tv.+(samsung)/i\n ], [VENDOR, [TYPE, SMARTTV], MODEL], [\n /((s[cgp]h-\\w+|gt-\\w+|galaxy\\snexus|sm-\\w[\\w\\d]+))/i,\n /(sam[sung]*)[\\s-]*(\\w+-?[\\w-]*)*/i,\n /sec-((sgh\\w+))/i\n ], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [\n\n /sie-(\\w+)*/i // Siemens\n ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n\n /(maemo|nokia).*(n900|lumia\\s\\d+)/i, // Nokia\n /(nokia)[\\s_-]?([\\w-]+)*/i\n ], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [\n\n /android\\s3\\.[\\s\\w;-]{10}(a\\d{3})/i // Acer\n ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n /android.+([vl]k\\-?\\d{3})\\s+build/i // LG Tablet\n ], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [\n /android\\s3\\.[\\s\\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet\n ], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [\n /(lg) netcast\\.tv/i // LG SmartTV\n ], [VENDOR, MODEL, [TYPE, SMARTTV]], [\n /(nexus\\s[45])/i, // LG\n /lg[e;\\s\\/-]+(\\w+)*/i,\n /android.+lg(\\-?[\\d\\w]+)\\s+build/i\n ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [\n\n /android.+(ideatab[a-z0-9\\-\\s]+)/i // Lenovo\n ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n\n /linux;.+((jolla));/i // Jolla\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /((pebble))app\\/[\\d\\.]+\\s/i // Pebble\n ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n\n /android.+;\\s(oppo)\\s?([\\w\\s]+)\\sbuild/i // OPPO\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /crkey/i // Google Chromecast\n ], [[MODEL, 'Chromecast'], [VENDOR, 'Google']], [\n\n /android.+;\\s(glass)\\s\\d/i // Google Glass\n ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [\n\n /android.+;\\s(pixel c)\\s/i // Google Pixel C\n ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [\n\n /android.+;\\s(pixel xl|pixel)\\s/i // Google Pixel\n ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [\n\n /android.+(\\w+)\\s+build\\/hm\\1/i, // Xiaomi Hongmi 'numeric' models\n /android.+(hm[\\s\\-_]*note?[\\s_]*(?:\\d\\w)?)\\s+build/i, // Xiaomi Hongmi\n /android.+(mi[\\s\\-_]*(?:one|one[\\s_]plus|note lte)?[\\s_]*(?:\\d\\w)?)\\s+build/i, // Xiaomi Mi\n /android.+(redmi[\\s\\-_]*(?:note)?(?:[\\s_]*[\\w\\s]+)?)\\s+build/i // Redmi Phones\n ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [\n /android.+(mi[\\s\\-_]*(?:pad)?(?:[\\s_]*[\\w\\s]+)?)\\s+build/i // Mi Pad tablets\n ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [\n /android.+;\\s(m[1-5]\\snote)\\sbuild/i // Meizu Tablet\n ], [MODEL, [VENDOR, 'Meizu'], [TYPE, TABLET]], [\n\n /android.+a000(1)\\s+build/i // OnePlus\n ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n /android.+[;\\/]\\s*(RCT[\\d\\w]+)\\s+build/i // RCA Tablets\n ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Venue[\\d\\s]*)\\s+build/i // Dell Venue Tablets\n ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Q[T|M][\\d\\w]+)\\s+build/i // Verizon Tablet\n ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s+(Barnes[&\\s]+Noble\\s+|BN[RT])(V?.*)\\s+build/i // Barnes & Noble Tablet\n ], [[VENDOR, 'Barnes & Noble'], MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s+(TM\\d{3}.*\\b)\\s+build/i // Barnes & Noble Tablet\n ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(zte)?.+(k\\d{2})\\s+build/i // ZTE K Series Tablet\n ], [[VENDOR, 'ZTE'], MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(gen\\d{3})\\s+build.*49h/i // Swiss GEN Mobile\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n\n /android.+[;\\/]\\s*(zur\\d{3})\\s+build/i // Swiss ZUR Tablet\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*((Zeki)?TB.*\\b)\\s+build/i // Zeki Tablets\n ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n\n /(android).+[;\\/]\\s+([YR]\\d{2}x?.*)\\s+build/i,\n /android.+[;\\/]\\s+(Dragon[\\-\\s]+Touch\\s+|DT)(.+)\\s+build/i // Dragon Touch Tablet\n ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(NS-?.+)\\s+build/i // Insignia Tablets\n ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*((NX|Next)-?.+)\\s+build/i // NextBook Tablets\n ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Xtreme\\_?)?(V(1[045]|2[015]|30|40|60|7[05]|90))\\s+build/i\n ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones\n\n /android.+[;\\/]\\s*(LVTEL\\-?)?(V1[12])\\s+build/i // LvTel Phones\n ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n\n /android.+[;\\/]\\s*(V(100MD|700NA|7011|917G).*\\b)\\s+build/i // Envizen Tablets\n ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Le[\\s\\-]+Pan)[\\s\\-]+(.*\\b)\\s+build/i // Le Pan Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Trio[\\s\\-]*.*)\\s+build/i // MachSpeed Tablets\n ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Trinity)[\\-\\s]*(T\\d{3})\\s+build/i // Trinity Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*TU_(1491)\\s+build/i // Rotor Tablets\n ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n\n /android.+(KS(.+))\\s+build/i // Amazon Kindle Tablets\n ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [\n\n /android.+(Gigaset)[\\s\\-]+(Q.+)\\s+build/i // Gigaset Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /\\s(tablet|tab)[;\\/]/i, // Unidentifiable Tablet\n /\\s(mobile)(?:[;\\/]|\\ssafari)/i // Unidentifiable Mobile\n ], [[TYPE, util.lowerize], VENDOR, MODEL], [\n\n /(android.+)[;\\/].+build/i // Generic Android Device\n ], [MODEL, [VENDOR, 'Generic']]\n\n\n /*//////////////////////////\n // TODO: move to string map\n ////////////////////////////\n\n /(C6603)/i // Sony Xperia Z C6603\n ], [[MODEL, 'Xperia Z C6603'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [\n /(C6903)/i // Sony Xperia Z 1\n ], [[MODEL, 'Xperia Z 1'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [\n\n /(SM-G900[F|H])/i // Samsung Galaxy S5\n ], [[MODEL, 'Galaxy S5'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [\n /(SM-G7102)/i // Samsung Galaxy Grand 2\n ], [[MODEL, 'Galaxy Grand 2'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [\n /(SM-G530H)/i // Samsung Galaxy Grand Prime\n ], [[MODEL, 'Galaxy Grand Prime'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [\n /(SM-G313HZ)/i // Samsung Galaxy V\n ], [[MODEL, 'Galaxy V'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [\n /(SM-T805)/i // Samsung Galaxy Tab S 10.5\n ], [[MODEL, 'Galaxy Tab S 10.5'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [\n /(SM-G800F)/i // Samsung Galaxy S5 Mini\n ], [[MODEL, 'Galaxy S5 Mini'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [\n /(SM-T311)/i // Samsung Galaxy Tab 3 8.0\n ], [[MODEL, 'Galaxy Tab 3 8.0'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [\n\n /(T3C)/i // Advan Vandroid T3C\n ], [MODEL, [VENDOR, 'Advan'], [TYPE, TABLET]], [\n /(ADVAN T1J\\+)/i // Advan Vandroid T1J+\n ], [[MODEL, 'Vandroid T1J+'], [VENDOR, 'Advan'], [TYPE, TABLET]], [\n /(ADVAN S4A)/i // Advan Vandroid S4A\n ], [[MODEL, 'Vandroid S4A'], [VENDOR, 'Advan'], [TYPE, MOBILE]], [\n\n /(V972M)/i // ZTE V972M\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [\n\n /(i-mobile)\\s(IQ\\s[\\d\\.]+)/i // i-mobile IQ\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /(IQ6.3)/i // i-mobile IQ IQ 6.3\n ], [[MODEL, 'IQ 6.3'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [\n /(i-mobile)\\s(i-style\\s[\\d\\.]+)/i // i-mobile i-STYLE\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /(i-STYLE2.1)/i // i-mobile i-STYLE 2.1\n ], [[MODEL, 'i-STYLE 2.1'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [\n\n /(mobiistar touch LAI 512)/i // mobiistar touch LAI 512\n ], [[MODEL, 'Touch LAI 512'], [VENDOR, 'mobiistar'], [TYPE, MOBILE]], [\n\n /////////////\n // END TODO\n ///////////*/\n\n ],\n\n engine : [[\n\n /windows.+\\sedge\\/([\\w\\.]+)/i // EdgeHTML\n ], [VERSION, [NAME, 'EdgeHTML']], [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\\/([\\w\\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m\n /(khtml|tasman|links)[\\/\\s]\\(?([\\w\\.]+)/i, // KHTML/Tasman/Links\n /(icab)[\\/\\s]([23]\\.[\\d\\.]+)/i // iCab\n ], [NAME, VERSION], [\n\n /rv\\:([\\w\\.]+).*(gecko)/i // Gecko\n ], [VERSION, NAME]\n ],\n\n os : [[\n\n // Windows based\n /microsoft\\s(windows)\\s(vista|xp)/i // Windows (iTunes)\n ], [NAME, VERSION], [\n /(windows)\\snt\\s6\\.2;\\s(arm)/i, // Windows RT\n /(windows\\sphone(?:\\sos)*)[\\s\\/]?([\\d\\.\\s]+\\w)*/i, // Windows Phone\n /(windows\\smobile|windows)[\\s\\/]?([ntce\\d\\.\\s]+\\w)/i\n ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [\n /(win(?=3|9|n)|win\\s9x\\s)([nt\\d\\.]+)/i\n ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [\n\n // Mobile/Embedded OS\n /\\((bb)(10);/i // BlackBerry 10\n ], [[NAME, 'BlackBerry'], VERSION], [\n /(blackberry)\\w*\\/?([\\w\\.]+)*/i, // Blackberry\n /(tizen)[\\/\\s]([\\w\\.]+)/i, // Tizen\n /(android|webos|palm\\sos|qnx|bada|rim\\stablet\\sos|meego|contiki)[\\/\\s-]?([\\w\\.]+)*/i,\n // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki\n /linux;.+(sailfish);/i // Sailfish OS\n ], [NAME, VERSION], [\n /(symbian\\s?os|symbos|s60(?=;))[\\/\\s-]?([\\w\\.]+)*/i // Symbian\n ], [[NAME, 'Symbian'], VERSION], [\n /\\((series40);/i // Series 40\n ], [NAME], [\n /mozilla.+\\(mobile;.+gecko.+firefox/i // Firefox OS\n ], [[NAME, 'Firefox OS'], VERSION], [\n\n // Console\n /(nintendo|playstation)\\s([wids34portablevu]+)/i, // Nintendo/Playstation\n\n // GNU/Linux based\n /(mint)[\\/\\s\\(]?(\\w+)*/i, // Mint\n /(mageia|vectorlinux)[;\\s]/i, // Mageia/VectorLinux\n /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\\/\\s-]?(?!chrom)([\\w\\.-]+)*/i,\n // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware\n // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus\n /(hurd|linux)\\s?([\\w\\.]+)*/i, // Hurd/Linux\n /(gnu)\\s?([\\w\\.]+)*/i // GNU\n ], [NAME, VERSION], [\n\n /(cros)\\s[\\w]+\\s([\\w\\.]+\\w)/i // Chromium OS\n ], [[NAME, 'Chromium OS'], VERSION],[\n\n // Solaris\n /(sunos)\\s?([\\w\\.]+\\d)*/i // Solaris\n ], [[NAME, 'Solaris'], VERSION], [\n\n // BSD based\n /\\s([frentopc-]{0,4}bsd|dragonfly)\\s?([\\w\\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly\n ], [NAME, VERSION],[\n\n /(haiku)\\s(\\w+)/i // Haiku\n ], [NAME, VERSION],[\n\n /cfnetwork\\/.+darwin/i,\n /ip[honead]+(?:.*os\\s([\\w]+)\\slike\\smac|;\\sopera)/i // iOS\n ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n\n /(mac\\sos\\sx)\\s?([\\w\\s\\.]+\\w)*/i,\n /(macintosh|mac(?=_powerpc)\\s)/i // Mac OS\n ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [\n\n // Other\n /((?:open)?solaris)[\\/\\s-]?([\\w\\.]+)*/i, // Solaris\n /(aix)\\s((\\d)(?=\\.|\\)|\\s)[\\w\\.]*)*/i, // AIX\n /(plan\\s9|minix|beos|os\\/2|amigaos|morphos|risc\\sos|openvms)/i,\n // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS\n /(unix)\\s?([\\w\\.]+)*/i // UNIX\n ], [NAME, VERSION]\n ]\n };\n\n\n /////////////////\n // Constructor\n ////////////////\n /*\n var Browser = function (name, version) {\n this[NAME] = name;\n this[VERSION] = version;\n };\n var CPU = function (arch) {\n this[ARCHITECTURE] = arch;\n };\n var Device = function (vendor, model, type) {\n this[VENDOR] = vendor;\n this[MODEL] = model;\n this[TYPE] = type;\n };\n var Engine = Browser;\n var OS = Browser;\n */\n var UAParser = function (uastring, extensions) {\n\n if (typeof uastring === 'object') {\n extensions = uastring;\n uastring = undefined;\n }\n\n if (!(this instanceof UAParser)) {\n return new UAParser(uastring, extensions).getResult();\n }\n\n var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);\n var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;\n //var browser = new Browser();\n //var cpu = new CPU();\n //var device = new Device();\n //var engine = new Engine();\n //var os = new OS();\n\n this.getBrowser = function () {\n var browser = { name: undefined, version: undefined };\n mapper.rgx.call(browser, ua, rgxmap.browser);\n browser.major = util.major(browser.version); // deprecated\n return browser;\n };\n this.getCPU = function () {\n var cpu = { architecture: undefined };\n mapper.rgx.call(cpu, ua, rgxmap.cpu);\n return cpu;\n };\n this.getDevice = function () {\n var device = { vendor: undefined, model: undefined, type: undefined };\n mapper.rgx.call(device, ua, rgxmap.device);\n return device;\n };\n this.getEngine = function () {\n var engine = { name: undefined, version: undefined };\n mapper.rgx.call(engine, ua, rgxmap.engine);\n return engine;\n };\n this.getOS = function () {\n var os = { name: undefined, version: undefined };\n mapper.rgx.call(os, ua, rgxmap.os);\n return os;\n };\n this.getResult = function () {\n return {\n ua : this.getUA(),\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice(),\n cpu : this.getCPU()\n };\n };\n this.getUA = function () {\n return ua;\n };\n this.setUA = function (uastring) {\n ua = uastring;\n //browser = new Browser();\n //cpu = new CPU();\n //device = new Device();\n //engine = new Engine();\n //os = new OS();\n return this;\n };\n return this;\n };\n\n UAParser.VERSION = LIBVERSION;\n UAParser.BROWSER = {\n NAME : NAME,\n MAJOR : MAJOR, // deprecated\n VERSION : VERSION\n };\n UAParser.CPU = {\n ARCHITECTURE : ARCHITECTURE\n };\n UAParser.DEVICE = {\n MODEL : MODEL,\n VENDOR : VENDOR,\n TYPE : TYPE,\n CONSOLE : CONSOLE,\n MOBILE : MOBILE,\n SMARTTV : SMARTTV,\n TABLET : TABLET,\n WEARABLE: WEARABLE,\n EMBEDDED: EMBEDDED\n };\n UAParser.ENGINE = {\n NAME : NAME,\n VERSION : VERSION\n };\n UAParser.OS = {\n NAME : NAME,\n VERSION : VERSION\n };\n //UAParser.Utils = util;\n\n ///////////\n // Export\n //////////\n\n\n // check js environment\n if (typeof(exports) !== UNDEF_TYPE) {\n // nodejs env\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser;\n }\n // TODO: test!!!!!!!!\n /*\n if (require && require.main === module && process) {\n // cli\n var jsonize = function (arr) {\n var res = [];\n for (var i in arr) {\n res.push(new UAParser(arr[i]).getResult());\n }\n process.stdout.write(JSON.stringify(res, null, 2) + '\\n');\n };\n if (process.stdin.isTTY) {\n // via args\n jsonize(process.argv.slice(2));\n } else {\n // via pipe\n var str = '';\n process.stdin.on('readable', function() {\n var read = process.stdin.read();\n if (read !== null) {\n str += read;\n }\n });\n process.stdin.on('end', function () {\n jsonize(str.replace(/\\n$/, '').split('\\n'));\n });\n }\n }\n */\n exports.UAParser = UAParser;\n } else {\n // requirejs env (optional)\n if (typeof(define) === FUNC_TYPE && define.amd) {\n define(function () {\n return UAParser;\n });\n } else if (window) {\n // browser env\n window.UAParser = UAParser;\n }\n }\n\n // jQuery/Zepto specific (optional)\n // Note:\n // In AMD env the global scope should be kept clean, but jQuery is an exception.\n // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n // and we should catch that.\n var $ = window && (window.jQuery || window.Zepto);\n if (typeof $ !== UNDEF_TYPE) {\n var parser = new UAParser();\n $.ua = parser.getResult();\n $.ua.get = function () {\n return parser.getUA();\n };\n $.ua.set = function (uastring) {\n parser.setUA(uastring);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n\n})(typeof window === 'object' ? window : this);\n"},{"id":97,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/webpack/buildin/amd-options.js","name":"(webpack)/buildin/amd-options.js","index":66,"index2":55,"size":82,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/ua-parser-js/src/ua-parser.js","issuerId":96,"issuerName":"./node_modules/ua-parser-js/src/ua-parser.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":96,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/ua-parser-js/src/ua-parser.js","module":"./node_modules/ua-parser-js/src/ua-parser.js","moduleName":"./node_modules/ua-parser-js/src/ua-parser.js","type":"amd require","userRequest":"define.amd","loc":"1041:44-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"/* globals __webpack_amd_options__ */\r\nmodule.exports = __webpack_amd_options__;\r\n"},{"id":98,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/VersionRange.js","name":"./node_modules/fbjs/lib/VersionRange.js","index":67,"index2":58,"size":10441,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","issuerId":11,"issuerName":"./node_modules/fbjs/lib/UserAgent.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":11,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","module":"./node_modules/fbjs/lib/UserAgent.js","moduleName":"./node_modules/fbjs/lib/UserAgent.js","type":"cjs require","userRequest":"./VersionRange","loc":"12:19-44"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar invariant = require('./invariant');\n\nvar componentRegex = /\\./;\nvar orRegex = /\\|\\|/;\nvar rangeRegex = /\\s+\\-\\s+/;\nvar modifierRegex = /^(<=|<|=|>=|~>|~|>|)?\\s*(.+)/;\nvar numericRegex = /^(\\d*)(.*)/;\n\n/**\n * Splits input `range` on \"||\" and returns true if any subrange matches\n * `version`.\n *\n * @param {string} range\n * @param {string} version\n * @returns {boolean}\n */\nfunction checkOrExpression(range, version) {\n var expressions = range.split(orRegex);\n\n if (expressions.length > 1) {\n return expressions.some(function (range) {\n return VersionRange.contains(range, version);\n });\n } else {\n range = expressions[0].trim();\n return checkRangeExpression(range, version);\n }\n}\n\n/**\n * Splits input `range` on \" - \" (the surrounding whitespace is required) and\n * returns true if version falls between the two operands.\n *\n * @param {string} range\n * @param {string} version\n * @returns {boolean}\n */\nfunction checkRangeExpression(range, version) {\n var expressions = range.split(rangeRegex);\n\n !(expressions.length > 0 && expressions.length <= 2) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'the \"-\" operator expects exactly 2 operands') : invariant(false) : void 0;\n\n if (expressions.length === 1) {\n return checkSimpleExpression(expressions[0], version);\n } else {\n var startVersion = expressions[0],\n endVersion = expressions[1];\n\n !(isSimpleVersion(startVersion) && isSimpleVersion(endVersion)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'operands to the \"-\" operator must be simple (no modifiers)') : invariant(false) : void 0;\n\n return checkSimpleExpression('>=' + startVersion, version) && checkSimpleExpression('<=' + endVersion, version);\n }\n}\n\n/**\n * Checks if `range` matches `version`. `range` should be a \"simple\" range (ie.\n * not a compound range using the \" - \" or \"||\" operators).\n *\n * @param {string} range\n * @param {string} version\n * @returns {boolean}\n */\nfunction checkSimpleExpression(range, version) {\n range = range.trim();\n if (range === '') {\n return true;\n }\n\n var versionComponents = version.split(componentRegex);\n\n var _getModifierAndCompon = getModifierAndComponents(range),\n modifier = _getModifierAndCompon.modifier,\n rangeComponents = _getModifierAndCompon.rangeComponents;\n\n switch (modifier) {\n case '<':\n return checkLessThan(versionComponents, rangeComponents);\n case '<=':\n return checkLessThanOrEqual(versionComponents, rangeComponents);\n case '>=':\n return checkGreaterThanOrEqual(versionComponents, rangeComponents);\n case '>':\n return checkGreaterThan(versionComponents, rangeComponents);\n case '~':\n case '~>':\n return checkApproximateVersion(versionComponents, rangeComponents);\n default:\n return checkEqual(versionComponents, rangeComponents);\n }\n}\n\n/**\n * Checks whether `a` is less than `b`.\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkLessThan(a, b) {\n return compareComponents(a, b) === -1;\n}\n\n/**\n * Checks whether `a` is less than or equal to `b`.\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkLessThanOrEqual(a, b) {\n var result = compareComponents(a, b);\n return result === -1 || result === 0;\n}\n\n/**\n * Checks whether `a` is equal to `b`.\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkEqual(a, b) {\n return compareComponents(a, b) === 0;\n}\n\n/**\n * Checks whether `a` is greater than or equal to `b`.\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkGreaterThanOrEqual(a, b) {\n var result = compareComponents(a, b);\n return result === 1 || result === 0;\n}\n\n/**\n * Checks whether `a` is greater than `b`.\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkGreaterThan(a, b) {\n return compareComponents(a, b) === 1;\n}\n\n/**\n * Checks whether `a` is \"reasonably close\" to `b` (as described in\n * https://www.npmjs.org/doc/misc/semver.html). For example, if `b` is \"1.3.1\"\n * then \"reasonably close\" is defined as \">= 1.3.1 and < 1.4\".\n *\n * @param {array} a\n * @param {array} b\n * @returns {boolean}\n */\nfunction checkApproximateVersion(a, b) {\n var lowerBound = b.slice();\n var upperBound = b.slice();\n\n if (upperBound.length > 1) {\n upperBound.pop();\n }\n var lastIndex = upperBound.length - 1;\n var numeric = parseInt(upperBound[lastIndex], 10);\n if (isNumber(numeric)) {\n upperBound[lastIndex] = numeric + 1 + '';\n }\n\n return checkGreaterThanOrEqual(a, lowerBound) && checkLessThan(a, upperBound);\n}\n\n/**\n * Extracts the optional modifier (<, <=, =, >=, >, ~, ~>) and version\n * components from `range`.\n *\n * For example, given `range` \">= 1.2.3\" returns an object with a `modifier` of\n * `\">=\"` and `components` of `[1, 2, 3]`.\n *\n * @param {string} range\n * @returns {object}\n */\nfunction getModifierAndComponents(range) {\n var rangeComponents = range.split(componentRegex);\n var matches = rangeComponents[0].match(modifierRegex);\n !matches ? process.env.NODE_ENV !== 'production' ? invariant(false, 'expected regex to match but it did not') : invariant(false) : void 0;\n\n return {\n modifier: matches[1],\n rangeComponents: [matches[2]].concat(rangeComponents.slice(1))\n };\n}\n\n/**\n * Determines if `number` is a number.\n *\n * @param {mixed} number\n * @returns {boolean}\n */\nfunction isNumber(number) {\n return !isNaN(number) && isFinite(number);\n}\n\n/**\n * Tests whether `range` is a \"simple\" version number without any modifiers\n * (\">\", \"~\" etc).\n *\n * @param {string} range\n * @returns {boolean}\n */\nfunction isSimpleVersion(range) {\n return !getModifierAndComponents(range).modifier;\n}\n\n/**\n * Zero-pads array `array` until it is at least `length` long.\n *\n * @param {array} array\n * @param {number} length\n */\nfunction zeroPad(array, length) {\n for (var i = array.length; i < length; i++) {\n array[i] = '0';\n }\n}\n\n/**\n * Normalizes `a` and `b` in preparation for comparison by doing the following:\n *\n * - zero-pads `a` and `b`\n * - marks any \"x\", \"X\" or \"*\" component in `b` as equivalent by zero-ing it out\n * in both `a` and `b`\n * - marks any final \"*\" component in `b` as a greedy wildcard by zero-ing it\n * and all of its successors in `a`\n *\n * @param {array} a\n * @param {array} b\n * @returns {array>}\n */\nfunction normalizeVersions(a, b) {\n a = a.slice();\n b = b.slice();\n\n zeroPad(a, b.length);\n\n // mark \"x\" and \"*\" components as equal\n for (var i = 0; i < b.length; i++) {\n var matches = b[i].match(/^[x*]$/i);\n if (matches) {\n b[i] = a[i] = '0';\n\n // final \"*\" greedily zeros all remaining components\n if (matches[0] === '*' && i === b.length - 1) {\n for (var j = i; j < a.length; j++) {\n a[j] = '0';\n }\n }\n }\n }\n\n zeroPad(b, a.length);\n\n return [a, b];\n}\n\n/**\n * Returns the numerical -- not the lexicographical -- ordering of `a` and `b`.\n *\n * For example, `10-alpha` is greater than `2-beta`.\n *\n * @param {string} a\n * @param {string} b\n * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,\n * or greater than `b`, respectively\n */\nfunction compareNumeric(a, b) {\n var aPrefix = a.match(numericRegex)[1];\n var bPrefix = b.match(numericRegex)[1];\n var aNumeric = parseInt(aPrefix, 10);\n var bNumeric = parseInt(bPrefix, 10);\n\n if (isNumber(aNumeric) && isNumber(bNumeric) && aNumeric !== bNumeric) {\n return compare(aNumeric, bNumeric);\n } else {\n return compare(a, b);\n }\n}\n\n/**\n * Returns the ordering of `a` and `b`.\n *\n * @param {string|number} a\n * @param {string|number} b\n * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,\n * or greater than `b`, respectively\n */\nfunction compare(a, b) {\n !(typeof a === typeof b) ? process.env.NODE_ENV !== 'production' ? invariant(false, '\"a\" and \"b\" must be of the same type') : invariant(false) : void 0;\n\n if (a > b) {\n return 1;\n } else if (a < b) {\n return -1;\n } else {\n return 0;\n }\n}\n\n/**\n * Compares arrays of version components.\n *\n * @param {array} a\n * @param {array} b\n * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,\n * or greater than `b`, respectively\n */\nfunction compareComponents(a, b) {\n var _normalizeVersions = normalizeVersions(a, b),\n aNormalized = _normalizeVersions[0],\n bNormalized = _normalizeVersions[1];\n\n for (var i = 0; i < bNormalized.length; i++) {\n var result = compareNumeric(aNormalized[i], bNormalized[i]);\n if (result) {\n return result;\n }\n }\n\n return 0;\n}\n\nvar VersionRange = {\n /**\n * Checks whether `version` satisfies the `range` specification.\n *\n * We support a subset of the expressions defined in\n * https://www.npmjs.org/doc/misc/semver.html:\n *\n * version Must match version exactly\n * =version Same as just version\n * >version Must be greater than version\n * >=version Must be greater than or equal to version\n * = 1.2.3 and < 1.3\"\n * ~>version Equivalent to ~version\n * 1.2.x Must match \"1.2.x\", where \"x\" is a wildcard that matches\n * anything\n * 1.2.* Similar to \"1.2.x\", but \"*\" in the trailing position is a\n * \"greedy\" wildcard, so will match any number of additional\n * components:\n * \"1.2.*\" will match \"1.2.1\", \"1.2.1.1\", \"1.2.1.1.1\" etc\n * * Any version\n * \"\" (Empty string) Same as *\n * v1 - v2 Equivalent to \">= v1 and <= v2\"\n * r1 || r2 Passes if either r1 or r2 are satisfied\n *\n * @param {string} range\n * @param {string} version\n * @returns {boolean}\n */\n contains: function contains(range, version) {\n return checkOrExpression(range.trim(), version.trim());\n }\n};\n\nmodule.exports = VersionRange;"},{"id":99,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/mapObject.js","name":"./node_modules/fbjs/lib/mapObject.js","index":68,"index2":59,"size":1318,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","issuerId":11,"issuerName":"./node_modules/fbjs/lib/UserAgent.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":11,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","module":"./node_modules/fbjs/lib/UserAgent.js","moduleName":"./node_modules/fbjs/lib/UserAgent.js","type":"cjs require","userRequest":"./mapObject","loc":"14:16-38"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Executes the provided `callback` once for each enumerable own property in the\n * object and constructs a new object from the results. The `callback` is\n * invoked with three arguments:\n *\n * - the property value\n * - the property name\n * - the object being traversed\n *\n * Properties that are added after the call to `mapObject` will not be visited\n * by `callback`. If the values of existing properties are changed, the value\n * passed to `callback` will be the value at the time `mapObject` visits them.\n * Properties that are deleted before being visited are not visited.\n *\n * @grep function objectMap()\n * @grep function objMap()\n *\n * @param {?object} object\n * @param {function} callback\n * @param {*} context\n * @return {?object}\n */\nfunction mapObject(object, callback, context) {\n if (!object) {\n return null;\n }\n var result = {};\n for (var name in object) {\n if (hasOwnProperty.call(object, name)) {\n result[name] = callback.call(context, object[name], name, object);\n }\n }\n return result;\n}\n\nmodule.exports = mapObject;"},{"id":100,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/memoizeStringOnly.js","name":"./node_modules/fbjs/lib/memoizeStringOnly.js","index":69,"index2":60,"size":572,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","issuerId":11,"issuerName":"./node_modules/fbjs/lib/UserAgent.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":11,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/UserAgent.js","module":"./node_modules/fbjs/lib/UserAgent.js","moduleName":"./node_modules/fbjs/lib/UserAgent.js","type":"cjs require","userRequest":"./memoizeStringOnly","loc":"15:24-54"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @typechecks static-only\n */\n\n'use strict';\n\n/**\n * Memoizes the return value of a function that accepts one string argument.\n */\n\nfunction memoizeStringOnly(callback) {\n var cache = {};\n return function (string) {\n if (!cache.hasOwnProperty(string)) {\n cache[string] = callback.call(this, string);\n }\n return cache[string];\n };\n}\n\nmodule.exports = memoizeStringOnly;"},{"id":101,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/setDraftEditorSelection.js","name":"./lib/setDraftEditorSelection.js","index":70,"index2":69,"size":9158,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","issuerId":48,"issuerName":"./lib/DraftEditorLeaf.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":48,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorLeaf.react.js","module":"./lib/DraftEditorLeaf.react.js","moduleName":"./lib/DraftEditorLeaf.react.js","type":"cjs require","userRequest":"./setDraftEditorSelection","loc":"28:30-66"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar DraftJsDebugLogging = require('./DraftJsDebugLogging');\n\nvar containsNode = require('fbjs/lib/containsNode');\nvar getActiveElement = require('fbjs/lib/getActiveElement');\nvar invariant = require('fbjs/lib/invariant');\n\nfunction getAnonymizedDOM(node, getNodeLabels) {\n if (!node) {\n return '[empty]';\n }\n\n var anonymized = anonymizeTextWithin(node, getNodeLabels);\n if (anonymized.nodeType === Node.TEXT_NODE) {\n return anonymized.textContent;\n }\n\n !(anonymized instanceof Element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Node must be an Element if it is not a text node.') : invariant(false) : void 0;\n return anonymized.outerHTML;\n}\n\nfunction anonymizeTextWithin(node, getNodeLabels) {\n var labels = getNodeLabels !== undefined ? getNodeLabels(node) : [];\n\n if (node.nodeType === Node.TEXT_NODE) {\n var length = node.textContent.length;\n return document.createTextNode('[text ' + length + (labels.length ? ' | ' + labels.join(', ') : '') + ']');\n }\n\n var clone = node.cloneNode();\n if (clone.nodeType === 1 && labels.length) {\n clone.setAttribute('data-labels', labels.join(', '));\n }\n var childNodes = node.childNodes;\n for (var ii = 0; ii < childNodes.length; ii++) {\n clone.appendChild(anonymizeTextWithin(childNodes[ii], getNodeLabels));\n }\n\n return clone;\n}\n\nfunction getAnonymizedEditorDOM(node, getNodeLabels) {\n // grabbing the DOM content of the Draft editor\n var currentNode = node;\n while (currentNode) {\n if (currentNode instanceof Element && currentNode.hasAttribute('contenteditable')) {\n // found the Draft editor container\n return getAnonymizedDOM(currentNode, getNodeLabels);\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n return 'Could not find contentEditable parent of node';\n}\n\nfunction getNodeLength(node) {\n return node.nodeValue === null ? node.childNodes.length : node.nodeValue.length;\n}\n\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n */\nfunction setDraftEditorSelection(selectionState, node, blockKey, nodeStart, nodeEnd) {\n // It's possible that the editor has been removed from the DOM but\n // our selection code doesn't know it yet. Forcing selection in\n // this case may lead to errors, so just bail now.\n if (!containsNode(document.documentElement, node)) {\n return;\n }\n\n var selection = global.getSelection();\n var anchorKey = selectionState.getAnchorKey();\n var anchorOffset = selectionState.getAnchorOffset();\n var focusKey = selectionState.getFocusKey();\n var focusOffset = selectionState.getFocusOffset();\n var isBackward = selectionState.getIsBackward();\n\n // IE doesn't support backward selection. Swap key/offset pairs.\n if (!selection.extend && isBackward) {\n var tempKey = anchorKey;\n var tempOffset = anchorOffset;\n anchorKey = focusKey;\n anchorOffset = focusOffset;\n focusKey = tempKey;\n focusOffset = tempOffset;\n isBackward = false;\n }\n\n var hasAnchor = anchorKey === blockKey && nodeStart <= anchorOffset && nodeEnd >= anchorOffset;\n\n var hasFocus = focusKey === blockKey && nodeStart <= focusOffset && nodeEnd >= focusOffset;\n\n // If the selection is entirely bound within this node, set the selection\n // and be done.\n if (hasAnchor && hasFocus) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n return;\n }\n\n if (!isBackward) {\n // If the anchor is within this node, set the range start.\n if (hasAnchor) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n }\n\n // If the focus is within this node, we can assume that we have\n // already set the appropriate start range on the selection, and\n // can simply extend the selection.\n if (hasFocus) {\n addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n }\n } else {\n // If this node has the focus, set the selection range to be a\n // collapsed range beginning here. Later, when we encounter the anchor,\n // we'll use this information to extend the selection.\n if (hasFocus) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, focusOffset - nodeStart, selectionState);\n }\n\n // If this node has the anchor, we may assume that the correct\n // focus information is already stored on the selection object.\n // We keep track of it, reset the selection range, and extend it\n // back to the focus point.\n if (hasAnchor) {\n var storedFocusNode = selection.focusNode;\n var storedFocusOffset = selection.focusOffset;\n\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n addFocusToSelection(selection, storedFocusNode, storedFocusOffset, selectionState);\n }\n }\n}\n\n/**\n * Extend selection towards focus point.\n */\nfunction addFocusToSelection(selection, node, offset, selectionState) {\n var activeElement = getActiveElement();\n if (selection.extend && containsNode(activeElement, node)) {\n // If `extend` is called while another element has focus, an error is\n // thrown. We therefore disable `extend` if the active element is somewhere\n // other than the node we are selecting. This should only occur in Firefox,\n // since it is the only browser to support multiple selections.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=921444.\n\n // logging to catch bug that is being reported in t16250795\n if (offset > getNodeLength(node)) {\n // the call to 'selection.extend' is about to throw\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node),\n extraParams: JSON.stringify({ offset: offset }),\n selectionState: JSON.stringify(selectionState.toJS())\n });\n }\n\n // logging to catch bug that is being reported in t18110632\n var nodeWasFocus = node === selection.focusNode;\n try {\n selection.extend(node, offset);\n } catch (e) {\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node, function (n) {\n var labels = [];\n if (n === activeElement) {\n labels.push('active element');\n }\n if (n === selection.anchorNode) {\n labels.push('selection anchor node');\n }\n if (n === selection.focusNode) {\n labels.push('selection focus node');\n }\n return labels;\n }),\n extraParams: JSON.stringify({\n activeElementName: activeElement ? activeElement.nodeName : null,\n nodeIsFocus: node === selection.focusNode,\n nodeWasFocus: nodeWasFocus,\n selectionRangeCount: selection.rangeCount,\n selectionAnchorNodeName: selection.anchorNode ? selection.anchorNode.nodeName : null,\n selectionAnchorOffset: selection.anchorOffset,\n selectionFocusNodeName: selection.focusNode ? selection.focusNode.nodeName : null,\n selectionFocusOffset: selection.focusOffset,\n message: e ? '' + e : null,\n offset: offset\n }, null, 2),\n selectionState: JSON.stringify(selectionState.toJS(), null, 2)\n });\n // allow the error to be thrown -\n // better than continuing in a broken state\n throw e;\n }\n } else {\n // IE doesn't support extend. This will mean no backward selection.\n // Extract the existing selection range and add focus to it.\n // Additionally, clone the selection range. IE11 throws an\n // InvalidStateError when attempting to access selection properties\n // after the range is detached.\n var range = selection.getRangeAt(0);\n range.setEnd(node, offset);\n selection.addRange(range.cloneRange());\n }\n}\n\nfunction addPointToSelection(selection, node, offset, selectionState) {\n var range = document.createRange();\n // logging to catch bug that is being reported in t16250795\n if (offset > getNodeLength(node)) {\n // in this case we know that the call to 'range.setStart' is about to throw\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node),\n extraParams: JSON.stringify({ offset: offset }),\n selectionState: JSON.stringify(selectionState.toJS())\n });\n }\n range.setStart(node, offset);\n selection.addRange(range);\n}\n\nmodule.exports = setDraftEditorSelection;"},{"id":102,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/isTextNode.js","name":"./node_modules/fbjs/lib/isTextNode.js","index":74,"index2":66,"size":479,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/containsNode.js","issuerId":35,"issuerName":"./node_modules/fbjs/lib/containsNode.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":35,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/containsNode.js","module":"./node_modules/fbjs/lib/containsNode.js","moduleName":"./node_modules/fbjs/lib/containsNode.js","type":"cjs require","userRequest":"./isTextNode","loc":"12:17-40"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar isNode = require('./isNode');\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM text node.\n */\nfunction isTextNode(object) {\n return isNode(object) && object.nodeType == 3;\n}\n\nmodule.exports = isTextNode;"},{"id":103,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/isNode.js","name":"./node_modules/fbjs/lib/isNode.js","index":75,"index2":65,"size":702,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/isTextNode.js","issuerId":102,"issuerName":"./node_modules/fbjs/lib/isTextNode.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":102,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/isTextNode.js","module":"./node_modules/fbjs/lib/isTextNode.js","moduleName":"./node_modules/fbjs/lib/isTextNode.js","type":"cjs require","userRequest":"./isNode","loc":"12:13-32"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":6,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM node.\n */\nfunction isNode(object) {\n var doc = object ? object.ownerDocument || object : document;\n var defaultView = doc.defaultView || window;\n return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nmodule.exports = isNode;"},{"id":104,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getStyleProperty.js","name":"./node_modules/fbjs/lib/getStyleProperty.js","index":79,"index2":75,"size":1500,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/Style.js","issuerId":27,"issuerName":"./node_modules/fbjs/lib/Style.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":27,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/Style.js","module":"./node_modules/fbjs/lib/Style.js","moduleName":"./node_modules/fbjs/lib/Style.js","type":"cjs require","userRequest":"./getStyleProperty","loc":"12:23-52"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar camelize = require('./camelize');\nvar hyphenate = require('./hyphenate');\n\nfunction asString(value) /*?string*/{\n return value == null ? value : String(value);\n}\n\nfunction getStyleProperty( /*DOMNode*/node, /*string*/name) /*?string*/{\n var computedStyle = void 0;\n\n // W3C Standard\n if (window.getComputedStyle) {\n // In certain cases such as within an iframe in FF3, this returns null.\n computedStyle = window.getComputedStyle(node, null);\n if (computedStyle) {\n return asString(computedStyle.getPropertyValue(hyphenate(name)));\n }\n }\n // Safari\n if (document.defaultView && document.defaultView.getComputedStyle) {\n computedStyle = document.defaultView.getComputedStyle(node, null);\n // A Safari bug causes this to return null for `display: none` elements.\n if (computedStyle) {\n return asString(computedStyle.getPropertyValue(hyphenate(name)));\n }\n if (name === 'display') {\n return 'none';\n }\n }\n // Internet Explorer\n if (node.currentStyle) {\n if (name === 'float') {\n return asString(node.currentStyle.cssFloat || node.currentStyle.styleFloat);\n }\n return asString(node.currentStyle[camelize(name)]);\n }\n return asString(node.style && node.style[camelize(name)]);\n}\n\nmodule.exports = getStyleProperty;"},{"id":105,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/camelize.js","name":"./node_modules/fbjs/lib/camelize.js","index":80,"index2":73,"size":582,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getStyleProperty.js","issuerId":104,"issuerName":"./node_modules/fbjs/lib/getStyleProperty.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":104,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getStyleProperty.js","module":"./node_modules/fbjs/lib/getStyleProperty.js","moduleName":"./node_modules/fbjs/lib/getStyleProperty.js","type":"cjs require","userRequest":"./camelize","loc":"12:15-36"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _hyphenPattern = /-(.)/g;\n\n/**\n * Camelcases a hyphenated string, for example:\n *\n * > camelize('background-color')\n * < \"backgroundColor\"\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelize(string) {\n return string.replace(_hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n}\n\nmodule.exports = camelize;"},{"id":106,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/hyphenate.js","name":"./node_modules/fbjs/lib/hyphenate.js","index":81,"index2":74,"size":674,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getStyleProperty.js","issuerId":104,"issuerName":"./node_modules/fbjs/lib/getStyleProperty.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":104,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getStyleProperty.js","module":"./node_modules/fbjs/lib/getStyleProperty.js","moduleName":"./node_modules/fbjs/lib/getStyleProperty.js","type":"cjs require","userRequest":"./hyphenate","loc":"13:16-38"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _uppercasePattern = /([A-Z])/g;\n\n/**\n * Hyphenates a camelcased string, for example:\n *\n * > hyphenate('backgroundColor')\n * < \"background-color\"\n *\n * For CSS style names, use `hyphenateStyleName` instead which works properly\n * with all vendor prefixes, including `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenate(string) {\n return string.replace(_uppercasePattern, '-$1').toLowerCase();\n}\n\nmodule.exports = hyphenate;"},{"id":107,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getElementRect.js","name":"./node_modules/fbjs/lib/getElementRect.js","index":83,"index2":77,"size":1340,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getElementPosition.js","issuerId":51,"issuerName":"./node_modules/fbjs/lib/getElementPosition.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":51,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getElementPosition.js","module":"./node_modules/fbjs/lib/getElementPosition.js","moduleName":"./node_modules/fbjs/lib/getElementPosition.js","type":"cjs require","userRequest":"./getElementRect","loc":"12:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar containsNode = require('./containsNode');\n\n/**\n * Gets an element's bounding rect in pixels relative to the viewport.\n *\n * @param {DOMElement} elem\n * @return {object}\n */\nfunction getElementRect(elem) {\n var docElem = elem.ownerDocument.documentElement;\n\n // FF 2, Safari 3 and Opera 9.5- do not support getBoundingClientRect().\n // IE9- will throw if the element is not in the document.\n if (!('getBoundingClientRect' in elem) || !containsNode(docElem, elem)) {\n return {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n }\n\n // Subtracts clientTop/Left because IE8- added a 2px border to the\n // element (see http://fburl.com/1493213). IE 7 in\n // Quicksmode does not report clientLeft/clientTop so there\n // will be an unaccounted offset of 2px when in quirksmode\n var rect = elem.getBoundingClientRect();\n\n return {\n left: Math.round(rect.left) - docElem.clientLeft,\n right: Math.round(rect.right) - docElem.clientLeft,\n top: Math.round(rect.top) - docElem.clientTop,\n bottom: Math.round(rect.bottom) - docElem.clientTop\n };\n}\n\nmodule.exports = getElementRect;"},{"id":108,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getDocumentScrollElement.js","name":"./node_modules/fbjs/lib/getDocumentScrollElement.js","index":85,"index2":79,"size":892,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getScrollPosition.js","issuerId":28,"issuerName":"./node_modules/fbjs/lib/getScrollPosition.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":28,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getScrollPosition.js","module":"./node_modules/fbjs/lib/getScrollPosition.js","moduleName":"./node_modules/fbjs/lib/getScrollPosition.js","type":"cjs require","userRequest":"./getDocumentScrollElement","loc":"12:31-68"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar isWebkit = typeof navigator !== 'undefined' && navigator.userAgent.indexOf('AppleWebKit') > -1;\n\n/**\n * Gets the element with the document scroll properties such as `scrollLeft` and\n * `scrollHeight`. This may differ across different browsers.\n *\n * NOTE: The return value can be null if the DOM is not yet ready.\n *\n * @param {?DOMDocument} doc Defaults to current document.\n * @return {?DOMElement}\n */\nfunction getDocumentScrollElement(doc) {\n doc = doc || document;\n if (doc.scrollingElement) {\n return doc.scrollingElement;\n }\n return !isWebkit && doc.compatMode === 'CSS1Compat' ? doc.documentElement : doc.body;\n}\n\nmodule.exports = getDocumentScrollElement;"},{"id":109,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getUnboundedScrollPosition.js","name":"./node_modules/fbjs/lib/getUnboundedScrollPosition.js","index":86,"index2":80,"size":996,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getScrollPosition.js","issuerId":28,"issuerName":"./node_modules/fbjs/lib/getScrollPosition.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":28,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/getScrollPosition.js","module":"./node_modules/fbjs/lib/getScrollPosition.js","moduleName":"./node_modules/fbjs/lib/getScrollPosition.js","type":"cjs require","userRequest":"./getUnboundedScrollPosition","loc":"13:33-72"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n'use strict';\n\n/**\n * Gets the scroll position of the supplied element or window.\n *\n * The return values are unbounded, unlike `getScrollPosition`. This means they\n * may be negative or exceed the element boundaries (which is possible using\n * inertial scrolling).\n *\n * @param {DOMWindow|DOMElement} scrollable\n * @return {object} Map with `x` and `y` keys.\n */\n\nfunction getUnboundedScrollPosition(scrollable) {\n if (scrollable.Window && scrollable instanceof scrollable.Window) {\n return {\n x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,\n y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop\n };\n }\n return {\n x: scrollable.scrollLeft,\n y: scrollable.scrollTop\n };\n}\n\nmodule.exports = getUnboundedScrollPosition;"},{"id":110,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","name":"./lib/DraftEditorContents-core.react.js","index":88,"index2":87,"size":9691,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","issuerId":89,"issuerName":"./lib/DraftEditorContents.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":89,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents.react.js","module":"./lib/DraftEditorContents.react.js","moduleName":"./lib/DraftEditorContents.react.js","type":"cjs require","userRequest":"./DraftEditorContents-core.react","loc":"19:100-143"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _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; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _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; }\n\nvar DraftEditorBlock = require('./DraftEditorBlock.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar EditorState = require('./EditorState');\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\nvar joinClasses = require('fbjs/lib/joinClasses');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Provide default styling for list items. This way, lists will be styled with\n * proper counters and indentation even if the caller does not specify\n * their own styling at all. If more than five levels of nesting are needed,\n * the necessary CSS classes can be provided via `blockStyleFn` configuration.\n */\nvar getListItemClasses = function getListItemClasses(type, depth, shouldResetCount, direction) {\n return cx({\n 'public/DraftStyleDefault/unorderedListItem': type === 'unordered-list-item',\n 'public/DraftStyleDefault/orderedListItem': type === 'ordered-list-item',\n 'public/DraftStyleDefault/reset': shouldResetCount,\n 'public/DraftStyleDefault/depth0': depth === 0,\n 'public/DraftStyleDefault/depth1': depth === 1,\n 'public/DraftStyleDefault/depth2': depth === 2,\n 'public/DraftStyleDefault/depth3': depth === 3,\n 'public/DraftStyleDefault/depth4': depth >= 4,\n 'public/DraftStyleDefault/listLTR': direction === 'LTR',\n 'public/DraftStyleDefault/listRTL': direction === 'RTL'\n });\n};\n\n/**\n * `DraftEditorContents` is the container component for all block components\n * rendered for a `DraftEditor`. It is optimized to aggressively avoid\n * re-rendering blocks whenever possible.\n *\n * This component is separate from `DraftEditor` because certain props\n * (for instance, ARIA props) must be allowed to update without affecting\n * the contents of the editor.\n */\n\nvar DraftEditorContents = function (_React$Component) {\n _inherits(DraftEditorContents, _React$Component);\n\n function DraftEditorContents() {\n _classCallCheck(this, DraftEditorContents);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n DraftEditorContents.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var prevEditorState = this.props.editorState;\n var nextEditorState = nextProps.editorState;\n\n var prevDirectionMap = prevEditorState.getDirectionMap();\n var nextDirectionMap = nextEditorState.getDirectionMap();\n\n // Text direction has changed for one or more blocks. We must re-render.\n if (prevDirectionMap !== nextDirectionMap) {\n return true;\n }\n\n var didHaveFocus = prevEditorState.getSelection().getHasFocus();\n var nowHasFocus = nextEditorState.getSelection().getHasFocus();\n\n if (didHaveFocus !== nowHasFocus) {\n return true;\n }\n\n var nextNativeContent = nextEditorState.getNativelyRenderedContent();\n\n var wasComposing = prevEditorState.isInCompositionMode();\n var nowComposing = nextEditorState.isInCompositionMode();\n\n // If the state is unchanged or we're currently rendering a natively\n // rendered state, there's nothing new to be done.\n if (prevEditorState === nextEditorState || nextNativeContent !== null && nextEditorState.getCurrentContent() === nextNativeContent || wasComposing && nowComposing) {\n return false;\n }\n\n var prevContent = prevEditorState.getCurrentContent();\n var nextContent = nextEditorState.getCurrentContent();\n var prevDecorator = prevEditorState.getDecorator();\n var nextDecorator = nextEditorState.getDecorator();\n return wasComposing !== nowComposing || prevContent !== nextContent || prevDecorator !== nextDecorator || nextEditorState.mustForceSelection();\n };\n\n DraftEditorContents.prototype.render = function render() {\n var _props = this.props,\n blockRenderMap = _props.blockRenderMap,\n blockRendererFn = _props.blockRendererFn,\n blockStyleFn = _props.blockStyleFn,\n customStyleMap = _props.customStyleMap,\n customStyleFn = _props.customStyleFn,\n editorState = _props.editorState,\n editorKey = _props.editorKey,\n textDirectionality = _props.textDirectionality;\n\n\n var content = editorState.getCurrentContent();\n var selection = editorState.getSelection();\n var forceSelection = editorState.mustForceSelection();\n var decorator = editorState.getDecorator();\n var directionMap = nullthrows(editorState.getDirectionMap());\n\n var blocksAsArray = content.getBlocksAsArray();\n var processedBlocks = [];\n\n var currentDepth = null;\n var lastWrapperTemplate = null;\n\n for (var ii = 0; ii < blocksAsArray.length; ii++) {\n var _block = blocksAsArray[ii];\n var key = _block.getKey();\n var blockType = _block.getType();\n\n var customRenderer = blockRendererFn(_block);\n var CustomComponent = void 0,\n customProps = void 0,\n customEditable = void 0;\n if (customRenderer) {\n CustomComponent = customRenderer.component;\n customProps = customRenderer.props;\n customEditable = customRenderer.editable;\n }\n\n var direction = textDirectionality ? textDirectionality : directionMap.get(key);\n var offsetKey = DraftOffsetKey.encode(key, 0, 0);\n var componentProps = {\n contentState: content,\n block: _block,\n blockProps: customProps,\n blockStyleFn: blockStyleFn,\n customStyleMap: customStyleMap,\n customStyleFn: customStyleFn,\n decorator: decorator,\n direction: direction,\n forceSelection: forceSelection,\n key: key,\n offsetKey: offsetKey,\n selection: selection,\n tree: editorState.getBlockTree(key)\n };\n\n var configForType = blockRenderMap.get(blockType) || blockRenderMap.get('unstyled');\n var wrapperTemplate = configForType.wrapper;\n\n var Element = configForType.element || blockRenderMap.get('unstyled').element;\n\n var depth = _block.getDepth();\n var className = '';\n if (blockStyleFn) {\n className = blockStyleFn(_block);\n }\n\n // List items are special snowflakes, since we handle nesting and\n // counters manually.\n if (Element === 'li') {\n var shouldResetCount = lastWrapperTemplate !== wrapperTemplate || currentDepth === null || depth > currentDepth;\n className = joinClasses(className, getListItemClasses(blockType, depth, shouldResetCount, direction));\n }\n\n var Component = CustomComponent || DraftEditorBlock;\n var childProps = {\n className: className,\n 'data-block': true,\n 'data-editor': editorKey,\n 'data-offset-key': offsetKey,\n key: key\n };\n if (customEditable !== undefined) {\n childProps = _extends({}, childProps, {\n contentEditable: customEditable,\n suppressContentEditableWarning: true\n });\n }\n\n var child = React.createElement(Element, childProps, React.createElement(Component, componentProps));\n\n processedBlocks.push({\n block: child,\n wrapperTemplate: wrapperTemplate,\n key: key,\n offsetKey: offsetKey\n });\n\n if (wrapperTemplate) {\n currentDepth = _block.getDepth();\n } else {\n currentDepth = null;\n }\n lastWrapperTemplate = wrapperTemplate;\n }\n\n // Group contiguous runs of blocks that have the same wrapperTemplate\n var outputBlocks = [];\n for (var _ii = 0; _ii < processedBlocks.length;) {\n var info = processedBlocks[_ii];\n if (info.wrapperTemplate) {\n var blocks = [];\n do {\n blocks.push(processedBlocks[_ii].block);\n _ii++;\n } while (_ii < processedBlocks.length && processedBlocks[_ii].wrapperTemplate === info.wrapperTemplate);\n var wrapperElement = React.cloneElement(info.wrapperTemplate, {\n key: info.key + '-wrap',\n 'data-offset-key': info.offsetKey\n }, blocks);\n outputBlocks.push(wrapperElement);\n } else {\n outputBlocks.push(info.block);\n _ii++;\n }\n }\n\n return React.createElement(\n 'div',\n { 'data-contents': 'true' },\n outputBlocks\n );\n };\n\n return DraftEditorContents;\n}(React.Component);\n\nmodule.exports = DraftEditorContents;"},{"id":111,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/joinClasses.js","name":"./node_modules/fbjs/lib/joinClasses.js","index":90,"index2":86,"size":803,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","issuerId":110,"issuerName":"./lib/DraftEditorContents-core.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":110,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorContents-core.react.js","module":"./lib/DraftEditorContents-core.react.js","moduleName":"./lib/DraftEditorContents-core.react.js","type":"cjs require","userRequest":"fbjs/lib/joinClasses","loc":"31:18-49"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks static-only\n */\n\n'use strict';\n\n/**\n * Combines multiple className strings into one.\n * http://jsperf.com/joinclasses-args-vs-array\n *\n * @param {...?string} className\n * @return {string}\n */\n\nfunction joinClasses(className /*, ... */) {\n if (!className) {\n className = '';\n }\n var nextClass = void 0;\n var argLength = arguments.length;\n if (argLength > 1) {\n for (var ii = 1; ii < argLength; ii++) {\n nextClass = arguments[ii];\n if (nextClass) {\n className = (className ? className + ' ' : '') + nextClass;\n }\n }\n }\n return className;\n}\n\nmodule.exports = joinClasses;"},{"id":112,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorDragHandler.js","name":"./lib/DraftEditorDragHandler.js","index":91,"index2":96,"size":3618,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DraftEditorDragHandler","loc":"30:29-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * \n */\n\n'use strict';\n\nvar DataTransfer = require('fbjs/lib/DataTransfer');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\n\nvar findAncestorOffsetKey = require('./findAncestorOffsetKey');\nvar getTextContentFromFiles = require('./getTextContentFromFiles');\nvar getUpdatedSelectionState = require('./getUpdatedSelectionState');\nvar isEventHandled = require('./isEventHandled');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Get a SelectionState for the supplied mouse event.\n */\nfunction getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n /* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error\n * found when Flow v0.68 was deployed. To see the error delete this comment\n * and run Flow. */\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}\n\nvar DraftEditorDragHandler = {\n /**\n * Drag originating from input terminated.\n */\n onDragEnd: function onDragEnd(editor) {\n editor.exitCurrentMode();\n },\n\n /**\n * Handle data being dropped.\n */\n onDrop: function onDrop(editor, e) {\n var data = new DataTransfer(e.nativeEvent.dataTransfer);\n\n var editorState = editor._latestEditorState;\n var dropSelection = getSelectionForEvent(e.nativeEvent, editorState);\n\n e.preventDefault();\n editor.exitCurrentMode();\n\n if (dropSelection == null) {\n return;\n }\n\n var files = data.getFiles();\n if (files.length > 0) {\n if (editor.props.handleDroppedFiles && isEventHandled(editor.props.handleDroppedFiles(dropSelection, files))) {\n return;\n }\n\n getTextContentFromFiles(files, function (fileText) {\n fileText && editor.update(insertTextAtSelection(editorState, dropSelection, fileText));\n });\n return;\n }\n\n var dragType = editor._internalDrag ? 'internal' : 'external';\n if (editor.props.handleDrop && isEventHandled(editor.props.handleDrop(dropSelection, data, dragType))) {\n return;\n }\n\n if (editor._internalDrag) {\n editor.update(moveText(editorState, dropSelection));\n return;\n }\n\n editor.update(insertTextAtSelection(editorState, dropSelection, data.getText()));\n }\n};\n\nfunction moveText(editorState, targetSelection) {\n var newContentState = DraftModifier.moveText(editorState.getCurrentContent(), editorState.getSelection(), targetSelection);\n return EditorState.push(editorState, newContentState, 'insert-fragment');\n}\n\n/**\n * Insert text at a specified selection.\n */\nfunction insertTextAtSelection(editorState, selection, text) {\n var newContentState = DraftModifier.insertText(editorState.getCurrentContent(), selection, text, editorState.getCurrentInlineStyle());\n return EditorState.push(editorState, newContentState, 'insert-fragment');\n}\n\nmodule.exports = DraftEditorDragHandler;"},{"id":113,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/PhotosMimeType.js","name":"./node_modules/fbjs/lib/PhotosMimeType.js","index":93,"index2":89,"size":642,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","issuerId":54,"issuerName":"./node_modules/fbjs/lib/DataTransfer.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":54,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","module":"./node_modules/fbjs/lib/DataTransfer.js","moduleName":"./node_modules/fbjs/lib/DataTransfer.js","type":"cjs require","userRequest":"./PhotosMimeType","loc":"14:21-48"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nvar PhotosMimeType = {\n isImage: function isImage(mimeString) {\n return getParts(mimeString)[0] === 'image';\n },\n isJpeg: function isJpeg(mimeString) {\n var parts = getParts(mimeString);\n return PhotosMimeType.isImage(mimeString) && (\n // see http://fburl.com/10972194\n parts[1] === 'jpeg' || parts[1] === 'pjpeg');\n }\n};\n\nfunction getParts(mimeString) {\n return mimeString.split('/');\n}\n\nmodule.exports = PhotosMimeType;"},{"id":114,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/createArrayFromMixed.js","name":"./node_modules/fbjs/lib/createArrayFromMixed.js","index":94,"index2":90,"size":3987,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","issuerId":54,"issuerName":"./node_modules/fbjs/lib/DataTransfer.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":54,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/DataTransfer.js","module":"./node_modules/fbjs/lib/DataTransfer.js","moduleName":"./node_modules/fbjs/lib/DataTransfer.js","type":"cjs require","userRequest":"./createArrayFromMixed","loc":"16:27-60"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar invariant = require('./invariant');\n\n/**\n * Convert array-like objects to arrays.\n *\n * This API assumes the caller knows the contents of the data type. For less\n * well defined inputs use createArrayFromMixed.\n *\n * @param {object|function|filelist} obj\n * @return {array}\n */\nfunction toArray(obj) {\n var length = obj.length;\n\n // Some browsers builtin objects can report typeof 'function' (e.g. NodeList\n // in old versions of Safari).\n !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;\n\n !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;\n\n !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;\n\n !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;\n\n // Old IE doesn't give collections access to hasOwnProperty. Assume inputs\n // without method will throw during the slice call and skip straight to the\n // fallback.\n if (obj.hasOwnProperty) {\n try {\n return Array.prototype.slice.call(obj);\n } catch (e) {\n // IE < 9 does not support Array#slice on collections objects\n }\n }\n\n // Fall back to copying key by key. This assumes all keys have a value,\n // so will not preserve sparsely populated inputs.\n var ret = Array(length);\n for (var ii = 0; ii < length; ii++) {\n ret[ii] = obj[ii];\n }\n return ret;\n}\n\n/**\n * Perform a heuristic test to determine if an object is \"array-like\".\n *\n * A monk asked Joshu, a Zen master, \"Has a dog Buddha nature?\"\n * Joshu replied: \"Mu.\"\n *\n * This function determines if its argument has \"array nature\": it returns\n * true if the argument is an actual array, an `arguments' object, or an\n * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).\n *\n * It will return false for other array-like objects like Filelist.\n *\n * @param {*} obj\n * @return {boolean}\n */\nfunction hasArrayNature(obj) {\n return (\n // not null/false\n !!obj && (\n // arrays are objects, NodeLists are functions in Safari\n typeof obj == 'object' || typeof obj == 'function') &&\n // quacks like an array\n 'length' in obj &&\n // not window\n !('setInterval' in obj) &&\n // no DOM node should be considered an array-like\n // a 'select' element has 'length' and 'item' properties on IE8\n typeof obj.nodeType != 'number' && (\n // a real array\n Array.isArray(obj) ||\n // arguments\n 'callee' in obj ||\n // HTMLCollection/NodeList\n 'item' in obj)\n );\n}\n\n/**\n * Ensure that the argument is an array by wrapping it in an array if it is not.\n * Creates a copy of the argument if it is already an array.\n *\n * This is mostly useful idiomatically:\n *\n * var createArrayFromMixed = require('createArrayFromMixed');\n *\n * function takesOneOrMoreThings(things) {\n * things = createArrayFromMixed(things);\n * ...\n * }\n *\n * This allows you to treat `things' as an array, but accept scalars in the API.\n *\n * If you need to convert an array-like object, like `arguments`, into an array\n * use toArray instead.\n *\n * @param {*} obj\n * @return {array}\n */\nfunction createArrayFromMixed(obj) {\n if (!hasArrayNature(obj)) {\n return [obj];\n } else if (Array.isArray(obj)) {\n return obj.slice();\n } else {\n return toArray(obj);\n }\n}\n\nmodule.exports = createArrayFromMixed;"},{"id":115,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorEditHandler.js","name":"./lib/DraftEditorEditHandler.js","index":99,"index2":143,"size":1243,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","issuerId":87,"issuerName":"./lib/DraftEditor.react.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":87,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditor.react.js","module":"./lib/DraftEditor.react.js","moduleName":"./lib/DraftEditor.react.js","type":"cjs require","userRequest":"./DraftEditorEditHandler","loc":"31:29-64"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":2,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar onBeforeInput = require('./editOnBeforeInput');\nvar onBlur = require('./editOnBlur');\nvar onCompositionStart = require('./editOnCompositionStart');\nvar onCopy = require('./editOnCopy');\nvar onCut = require('./editOnCut');\nvar onDragOver = require('./editOnDragOver');\nvar onDragStart = require('./editOnDragStart');\nvar onFocus = require('./editOnFocus');\nvar onInput = require('./editOnInput');\nvar onKeyDown = require('./editOnKeyDown');\nvar onPaste = require('./editOnPaste');\nvar onSelect = require('./editOnSelect');\n\nvar DraftEditorEditHandler = {\n onBeforeInput: onBeforeInput,\n onBlur: onBlur,\n onCompositionStart: onCompositionStart,\n onCopy: onCopy,\n onCut: onCut,\n onDragOver: onDragOver,\n onDragStart: onDragStart,\n onFocus: onFocus,\n onInput: onInput,\n onKeyDown: onKeyDown,\n onPaste: onPaste,\n onSelect: onSelect\n};\n\nmodule.exports = DraftEditorEditHandler;"},{"id":116,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","name":"./lib/editOnBeforeInput.js","index":100,"index2":100,"size":9472,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorEditHandler.js","issuerId":115,"issuerName":"./lib/DraftEditorEditHandler.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":115,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/DraftEditorEditHandler.js","module":"./lib/DraftEditorEditHandler.js","moduleName":"./lib/DraftEditorEditHandler.js","type":"cjs require","userRequest":"./editOnBeforeInput","loc":"15:20-50"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":3,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @format\n * strict-local\n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar getEntityKeyForSelection = require('./getEntityKeyForSelection');\nvar isEventHandled = require('./isEventHandled');\nvar isSelectionAtLeafStart = require('./isSelectionAtLeafStart');\nvar nullthrows = require('fbjs/lib/nullthrows');\nvar setImmediate = require('fbjs/lib/setImmediate');\n\n// When nothing is focused, Firefox regards two characters, `'` and `/`, as\n// commands that should open and focus the \"quickfind\" search bar. This should\n// *never* happen while a contenteditable is focused, but as of v28, it\n// sometimes does, even when the keypress event target is the contenteditable.\n// This breaks the input. Special case these characters to ensure that when\n// they are typed, we prevent default on the event to make sure not to\n// trigger quickfind.\nvar FF_QUICKFIND_CHAR = \"'\";\nvar FF_QUICKFIND_LINK_CHAR = '/';\nvar isFirefox = UserAgent.isBrowser('Firefox');\n\nfunction mustPreventDefaultForCharacter(character) {\n return isFirefox && (character == FF_QUICKFIND_CHAR || character == FF_QUICKFIND_LINK_CHAR);\n}\n\n/**\n * Replace the current selection with the specified text string, with the\n * inline style and entity key applied to the newly inserted text.\n */\nfunction replaceText(editorState, text, inlineStyle, entityKey) {\n var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), text, inlineStyle, entityKey);\n return EditorState.push(editorState, contentState, 'insert-characters');\n}\n\n/**\n * When `onBeforeInput` executes, the browser is attempting to insert a\n * character into the editor. Apply this character data to the document,\n * allowing native insertion if possible.\n *\n * Native insertion is encouraged in order to limit re-rendering and to\n * preserve spellcheck highlighting, which disappears or flashes if re-render\n * occurs on the relevant text nodes.\n */\nfunction editOnBeforeInput(editor, e) {\n if (editor._pendingStateFromBeforeInput !== undefined) {\n editor.update(editor._pendingStateFromBeforeInput);\n editor._pendingStateFromBeforeInput = undefined;\n }\n\n var editorState = editor._latestEditorState;\n\n var chars = e.data;\n\n // In some cases (ex: IE ideographic space insertion) no character data\n // is provided. There's nothing to do when this happens.\n if (!chars) {\n return;\n }\n\n // Allow the top-level component to handle the insertion manually. This is\n // useful when triggering interesting behaviors for a character insertion,\n // Simple examples: replacing a raw text ':)' with a smile emoji or image\n // decorator, or setting a block to be a list item after typing '- ' at the\n // start of the block.\n if (editor.props.handleBeforeInput && isEventHandled(editor.props.handleBeforeInput(chars, editorState, e.timeStamp))) {\n e.preventDefault();\n return;\n }\n\n // If selection is collapsed, conditionally allow native behavior. This\n // reduces re-renders and preserves spellcheck highlighting. If the selection\n // is not collapsed, we will re-render.\n var selection = editorState.getSelection();\n var selectionStart = selection.getStartOffset();\n var selectionEnd = selection.getEndOffset();\n var anchorKey = selection.getAnchorKey();\n\n if (!selection.isCollapsed()) {\n e.preventDefault();\n\n // If the currently selected text matches what the user is trying to\n // replace it with, let's just update the `SelectionState`. If not, update\n // the `ContentState` with the new text.\n var currentlySelectedChars = editorState.getCurrentContent().getPlainText().slice(selectionStart, selectionEnd);\n if (chars === currentlySelectedChars) {\n editor.update(EditorState.forceSelection(editorState, selection.merge({\n anchorOffset: selectionEnd,\n focusOffset: selectionEnd\n })));\n } else {\n editor.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n }\n return;\n }\n\n var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n // Bunch of different cases follow where we need to prevent native insertion.\n var mustPreventNative = false;\n if (!mustPreventNative) {\n // Browsers tend to insert text in weird places in the DOM when typing at\n // the start of a leaf, so we'll handle it ourselves.\n mustPreventNative = isSelectionAtLeafStart(editor._latestCommittedEditorState);\n }\n if (!mustPreventNative) {\n // Chrome will also split up a node into two pieces if it contains a Tab\n // char, for no explicable reason. Seemingly caused by this commit:\n // https://chromium.googlesource.com/chromium/src/+/013ac5eaf3%5E%21/\n var nativeSelection = global.getSelection();\n // Selection is necessarily collapsed at this point due to earlier check.\n if (nativeSelection.anchorNode && nativeSelection.anchorNode.nodeType === Node.TEXT_NODE) {\n // See isTabHTMLSpanElement in chromium EditingUtilities.cpp.\n var parentNode = nativeSelection.anchorNode.parentNode;\n mustPreventNative = parentNode.nodeName === 'SPAN' && parentNode.firstChild.nodeType === Node.TEXT_NODE && parentNode.firstChild.nodeValue.indexOf('\\t') !== -1;\n }\n }\n if (!mustPreventNative) {\n // Let's say we have a decorator that highlights hashtags. In many cases\n // we need to prevent native behavior and rerender ourselves --\n // particularly, any case *except* where the inserted characters end up\n // anywhere except exactly where you put them.\n //\n // Using [] to denote a decorated leaf, some examples:\n //\n // 1. 'hi #' and append 'f'\n // desired rendering: 'hi [#f]'\n // native rendering would be: 'hi #f' (incorrect)\n //\n // 2. 'x [#foo]' and insert '#' before 'f'\n // desired rendering: 'x #[#foo]'\n // native rendering would be: 'x [##foo]' (incorrect)\n //\n // 3. '[#foobar]' and insert ' ' between 'foo' and 'bar'\n // desired rendering: '[#foo] bar'\n // native rendering would be: '[#foo bar]' (incorrect)\n //\n // 4. '[#foo]' and delete '#' [won't use this beforeinput codepath though]\n // desired rendering: 'foo'\n // native rendering would be: '[foo]' (incorrect)\n //\n // 5. '[#foo]' and append 'b'\n // desired rendering: '[#foob]'\n // native rendering would be: '[#foob]' (native insertion is OK here)\n //\n // It is safe to allow native insertion if and only if the full list of\n // decorator ranges matches what we expect native insertion to give. We\n // don't need to compare the content because the only possible mutation\n // to consider here is inserting plain text and decorators can't affect\n // text content.\n var oldBlockTree = editorState.getBlockTree(anchorKey);\n var newBlockTree = newEditorState.getBlockTree(anchorKey);\n mustPreventNative = oldBlockTree.size !== newBlockTree.size || oldBlockTree.zip(newBlockTree).some(function (_ref) {\n var oldLeafSet = _ref[0],\n newLeafSet = _ref[1];\n\n // selectionStart is guaranteed to be selectionEnd here\n var oldStart = oldLeafSet.get('start');\n var adjustedStart = oldStart + (oldStart >= selectionStart ? chars.length : 0);\n var oldEnd = oldLeafSet.get('end');\n var adjustedEnd = oldEnd + (oldEnd >= selectionStart ? chars.length : 0);\n return (\n // Different decorators\n oldLeafSet.get('decoratorKey') !== newLeafSet.get('decoratorKey') ||\n // Different number of inline styles\n oldLeafSet.get('leaves').size !== newLeafSet.get('leaves').size ||\n // Different effective decorator position\n adjustedStart !== newLeafSet.get('start') || adjustedEnd !== newLeafSet.get('end')\n );\n });\n }\n if (!mustPreventNative) {\n mustPreventNative = mustPreventDefaultForCharacter(chars);\n }\n if (!mustPreventNative) {\n mustPreventNative = nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey);\n }\n\n if (mustPreventNative) {\n e.preventDefault();\n editor.update(newEditorState);\n return;\n }\n\n // We made it all the way! Let the browser do its thing and insert the char.\n newEditorState = EditorState.set(newEditorState, {\n nativelyRenderedContent: newEditorState.getCurrentContent()\n });\n // The native event is allowed to occur. To allow user onChange handlers to\n // change the inserted text, we wait until the text is actually inserted\n // before we actually update our state. That way when we rerender, the text\n // we see in the DOM will already have been inserted properly.\n editor._pendingStateFromBeforeInput = newEditorState;\n setImmediate(function () {\n if (editor._pendingStateFromBeforeInput !== undefined) {\n editor.update(editor._pendingStateFromBeforeInput);\n editor._pendingStateFromBeforeInput = undefined;\n }\n });\n}\n\nmodule.exports = editOnBeforeInput;"},{"id":117,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/setImmediate.js","name":"./node_modules/fbjs/lib/setImmediate.js","index":101,"index2":99,"size":369,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","issuerId":116,"issuerName":"./lib/editOnBeforeInput.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":116,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/lib/editOnBeforeInput.js","module":"./lib/editOnBeforeInput.js","moduleName":"./lib/editOnBeforeInput.js","type":"cjs require","userRequest":"fbjs/lib/setImmediate","loc":"23:19-51"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":4,"source":"/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n// setimmediate adds setImmediate to the global. We want to make sure we export\n// the actual function.\n\nrequire('setimmediate');\nmodule.exports = global.setImmediate;"},{"id":118,"identifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/setimmediate/setImmediate.js","name":"./node_modules/setimmediate/setImmediate.js","index":102,"index2":98,"size":6473,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"issuer":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/setImmediate.js","issuerId":117,"issuerName":"./node_modules/fbjs/lib/setImmediate.js","failed":false,"errors":0,"warnings":0,"reasons":[{"moduleId":117,"moduleIdentifier":"/Users/yangshun/Developer/docusaurus-users/draft-js/node_modules/fbjs/lib/setImmediate.js","module":"./node_modules/fbjs/lib/setImmediate.js","moduleName":"./node_modules/fbjs/lib/setImmediate.js","type":"cjs require","userRequest":"setimmediate","loc":"14:0-23"}],"usedExports":true,"providedExports":null,"optimizationBailout":[],"depth":5,"source":"(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a