{"version":3,"file":"react-contenteditable-Dkw95MlF.js","sources":["../../../client/node_modules/fast-deep-equal/index.js","../../../client/node_modules/react-contenteditable/lib/react-contenteditable.js"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar fast_deep_equal_1 = __importDefault(require(\"fast-deep-equal\"));\nvar PropTypes = __importStar(require(\"prop-types\"));\nfunction normalizeHtml(str) {\n return str && str.replace(/ |\\u202F|\\u00A0/g, ' ');\n}\nfunction replaceCaret(el) {\n // Place the caret at the end of the element\n var target = document.createTextNode('');\n el.appendChild(target);\n // do not move caret if element was not focused\n var isTargetFocused = document.activeElement === el;\n if (target !== null && target.nodeValue !== null && isTargetFocused) {\n var sel = window.getSelection();\n if (sel !== null) {\n var range = document.createRange();\n range.setStart(target, target.nodeValue.length);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n if (el instanceof HTMLElement)\n el.focus();\n }\n}\n/**\n * A simple component for an html element with editable contents.\n */\nvar ContentEditable = /** @class */ (function (_super) {\n __extends(ContentEditable, _super);\n function ContentEditable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastHtml = _this.props.html;\n _this.el = typeof _this.props.innerRef === 'function' ? { current: null } : React.createRef();\n _this.getEl = function () { return (_this.props.innerRef && typeof _this.props.innerRef !== 'function' ? _this.props.innerRef : _this.el).current; };\n _this.emitChange = function (originalEvt) {\n var el = _this.getEl();\n if (!el)\n return;\n var html = el.innerHTML;\n if (_this.props.onChange && html !== _this.lastHtml) {\n // Clone event with Object.assign to avoid\n // \"Cannot assign to read only property 'target' of object\"\n var evt = Object.assign({}, originalEvt, {\n target: {\n value: html\n }\n });\n _this.props.onChange(evt);\n }\n _this.lastHtml = html;\n };\n return _this;\n }\n ContentEditable.prototype.render = function () {\n var _this = this;\n var _a = this.props, tagName = _a.tagName, html = _a.html, innerRef = _a.innerRef, props = __rest(_a, [\"tagName\", \"html\", \"innerRef\"]);\n return React.createElement(tagName || 'div', __assign(__assign({}, props), { ref: typeof innerRef === 'function' ? function (current) {\n innerRef(current);\n _this.el.current = current;\n } : innerRef || this.el, onInput: this.emitChange, onBlur: this.props.onBlur || this.emitChange, onKeyUp: this.props.onKeyUp || this.emitChange, onKeyDown: this.props.onKeyDown || this.emitChange, contentEditable: !this.props.disabled, dangerouslySetInnerHTML: { __html: html } }), this.props.children);\n };\n ContentEditable.prototype.shouldComponentUpdate = function (nextProps) {\n var props = this.props;\n var el = this.getEl();\n // We need not rerender if the change of props simply reflects the user's edits.\n // Rerendering in this case would make the cursor/caret jump\n // Rerender if there is no element yet... (somehow?)\n if (!el)\n return true;\n // ...or if html really changed... (programmatically, not by user edit)\n if (normalizeHtml(nextProps.html) !== normalizeHtml(el.innerHTML)) {\n return true;\n }\n // Handle additional properties\n return props.disabled !== nextProps.disabled ||\n props.tagName !== nextProps.tagName ||\n props.className !== nextProps.className ||\n props.innerRef !== nextProps.innerRef ||\n props.placeholder !== nextProps.placeholder ||\n !fast_deep_equal_1.default(props.style, nextProps.style);\n };\n ContentEditable.prototype.componentDidUpdate = function () {\n var el = this.getEl();\n if (!el)\n return;\n // Perhaps React (whose VDOM gets outdated because we often prevent\n // rerendering) did not update the DOM. So we update it manually now.\n if (this.props.html !== el.innerHTML) {\n el.innerHTML = this.props.html;\n }\n this.lastHtml = this.props.html;\n replaceCaret(el);\n };\n ContentEditable.propTypes = {\n html: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n tagName: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n innerRef: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n ])\n };\n return ContentEditable;\n}(React.Component));\nexports.default = ContentEditable;\n"],"names":["fastDeepEqual","equal","a","b","length","i","keys","key","__extends","this","extendStatics","d","p","__","__assign","t","s","n","__createBinding","o","m","k","k2","__setModuleDefault","v","__importStar","mod","result","__rest","e","__importDefault","reactContenteditable","React","require$$0","fast_deep_equal_1","require$$1","PropTypes","require$$2","normalizeHtml","str","replaceCaret","el","target","isTargetFocused","sel","range","ContentEditable","_super","_this","originalEvt","html","evt","_a","tagName","innerRef","props","current","nextProps","_default"],"mappings":"oHAMAA,EAAiB,SAASC,EAAMC,EAAGC,EAAG,CAChC,GAAAD,IAAMC,EAAU,MAAA,GAEpB,GAAID,GAAKC,GAAK,OAAOD,GAAK,UAAY,OAAOC,GAAK,SAAU,CAC1D,GAAID,EAAE,cAAgBC,EAAE,YAAoB,MAAA,GAE5C,IAAIC,EAAQC,EAAGC,EACX,GAAA,MAAM,QAAQJ,CAAC,EAAG,CAEhB,GADJE,EAASF,EAAE,OACPE,GAAUD,EAAE,OAAe,MAAA,GAC1B,IAAAE,EAAID,EAAQ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