UNPKG

web-highlighter

Version:

âœĻA no-runtime dependency lib for text highlighting & persistence on any website âœĻ🖍ïļ

1 lines â€Ē 113 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Highlighter=e():t.Highlighter=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=80)}([function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(93))},function(t,e,n){var r=n(1),i=n(24),o=n(3),a=n(37),l=n(40),f=n(62),d=i("wks"),s=r.Symbol,c=f?s:s&&s.withoutSetter||a;t.exports=function(t){return o(d,t)&&(l||"string"==typeof d[t])||(l&&o(s,t)?d[t]=s[t]:d[t]=c("Symbol."+t)),d[t]}},function(t,e,n){var r=n(13),i={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return i.call(r(t),e)}},function(t,e,n){var r=n(1),i=n(33).f,o=n(5),a=n(19),l=n(35),f=n(57),d=n(98);t.exports=function(t,e){var n,s,c,h,u,p=t.target,g=t.global,m=t.stat;if(n=g?r:m?r[p]||l(p,{}):(r[p]||{}).prototype)for(s in e){if(h=e[s],c=t.noTargetGet?(u=i(n,s))&&u.value:n[s],!d(g?s:p+(m?".":"#")+s,t.forced)&&void 0!==c){if(typeof h==typeof c)continue;f(h,c)}(t.sham||c&&c.sham)&&o(h,"sham",!0),a(n,s,h,t)}}},function(t,e,n){var r=n(11),i=n(7),o=n(17);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(11),i=n(54),o=n(9),a=n(22),l=Object.defineProperty;e.f=r?l:function(t,e,n){if(o(t),e=a(e,!0),o(n),i)try{return l(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.eventEmitter=e.INTERNAL_ERROR_EVENT=e.UNKNOWN_IDX=e.ROOT_IDX=e.getStylesheet=e.getDefaultOptions=e.CAMEL_DATASET_SPLIT_TYPE=e.CAMEL_DATASET_IDENTIFIER_EXTRA=e.CAMEL_DATASET_IDENTIFIER=e.DATASET_SPLIT_TYPE=e.DATASET_IDENTIFIER_EXTRA=e.DATASET_IDENTIFIER=e.STYLESHEET_ID=e.LOCAL_STORE_KEY=e.ID_DIVISION=void 0;var a=o(n(82)),l=o(n(29));e.ID_DIVISION=";",e.LOCAL_STORE_KEY="highlight-mengshou",e.STYLESHEET_ID="highlight-mengshou-style",e.DATASET_IDENTIFIER="highlight-id",e.DATASET_IDENTIFIER_EXTRA="highlight-id-extra",e.DATASET_SPLIT_TYPE="highlight-split-type",e.CAMEL_DATASET_IDENTIFIER=a.default(e.DATASET_IDENTIFIER),e.CAMEL_DATASET_IDENTIFIER_EXTRA=a.default(e.DATASET_IDENTIFIER_EXTRA),e.CAMEL_DATASET_SPLIT_TYPE=a.default(e.DATASET_SPLIT_TYPE);e.getDefaultOptions=function(){return{$root:document||document.documentElement,exceptSelectors:null,wrapTag:"span",verbose:!1,style:{className:"highlight-mengshou-wrap"}}};e.getStylesheet=function(){return"\n ."+e.getDefaultOptions().style.className+" {\n background: #ff9;\n cursor: pointer;\n }\n ."+e.getDefaultOptions().style.className+".active {\n background: #ffb;\n }\n"},e.ROOT_IDX=-2,e.UNKNOWN_IDX=-1,e.INTERNAL_ERROR_EVENT="error";var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(l.default);e.eventEmitter=new f},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=a(n(29)),f=a(n(50)),d=a(n(30)),s=a(n(51)),c=a(n(85)),h=a(n(86)),u=a(n(88)),p=a(n(89)),g=n(8),m=n(15),v=n(31),y=function(t){function e(e){var n=t.call(this)||this;n.event=h.default(),n.run=function(){return v.addEventListener(n.options.$root,n.event.PointerEnd,n._handleSelection)},n.stop=function(){v.removeEventListener(n.options.$root,n.event.PointerEnd,n._handleSelection)},n.addClass=function(t,e){n.getDoms(e).forEach((function(e){v.addClass(e,t)}))},n.removeClass=function(t,e){n.getDoms(e).forEach((function(e){v.removeClass(e,t)}))},n.getIdByDom=function(t){return v.getHighlightId(t,n.options.$root)},n.getExtraIdByDom=function(t){return v.getExtraHighlightId(t,n.options.$root)},n.getDoms=function(t){return t?v.getHighlightById(n.options.$root,t,n.options.wrapTag):v.getHighlightsByRoot(n.options.$root,n.options.wrapTag)},n.dispose=function(){var t=n.options.$root;v.removeEventListener(t,n.event.PointerOver,n._handleHighlightHover),v.removeEventListener(t,n.event.PointerEnd,n._handleSelection),v.removeEventListener(t,n.event.PointerTap,n._handleHighlightClick),n.removeAll()},n.setOption=function(t){n.options=o(o({},n.options),t),n.painter=new p.default({$root:n.options.$root,wrapTag:n.options.wrapTag,className:n.options.style.className,exceptSelectors:n.options.exceptSelectors},n.hooks)},n.fromRange=function(t){var e={$node:t.startContainer,offset:t.startOffset},r={$node:t.endContainer,offset:t.endOffset},i=t.toString(),o=n.hooks.Render.UUID.call(e,r,i);o=null!=o?o:s.default();var a=new f.default(e,r,i,o);return a?n._highlightFromHRange(a):(g.eventEmitter.emit(g.INTERNAL_ERROR_EVENT,{type:m.ERROR.RANGE_INVALID}),null)},n.fromStore=function(t,e,r,i,o){var a=new d.default(t,e,r,i,o);try{return n._highlightFromHSource(a),a}catch(t){return g.eventEmitter.emit(g.INTERNAL_ERROR_EVENT,{type:m.ERROR.HIGHLIGHT_SOURCE_RECREATE,error:t,detail:a}),null}},n._getHooks=function(){return{Render:{UUID:new c.default("Render.UUID"),SelectedNodes:new c.default("Render.SelectedNodes"),WrapNode:new c.default("Render.WrapNode")},Serialize:{Restore:new c.default("Serialize.Restore"),RecordInfo:new c.default("Serialize.RecordInfo")},Remove:{UpdateNodes:new c.default("Remove.UpdateNodes")}}},n._highlightFromHRange=function(t){var e=t.serialize(n.options.$root,n.hooks);return 0===n.painter.highlightRange(t).length?(g.eventEmitter.emit(g.INTERNAL_ERROR_EVENT,{type:m.ERROR.DOM_SELECTION_EMPTY}),null):(n.cache.save(e),n.emit(m.EventType.CREATE,{sources:[e],type:m.CreateFrom.INPUT},n),e)},n._handleSelection=function(){var t=f.default.fromSelection(n.hooks.Render.UUID);t&&(n._highlightFromHRange(t),f.default.removeDomRange())},n._handleHighlightHover=function(t){var e=t.target;if(!v.isHighlightWrapNode(e))return n._hoverId&&n.emit(m.EventType.HOVER_OUT,{id:n._hoverId},n,t),void(n._hoverId=null);var r=v.getHighlightId(e,n.options.$root);n._hoverId!==r&&(n._hoverId&&n.emit(m.EventType.HOVER_OUT,{id:n._hoverId},n,t),n._hoverId=r,n.emit(m.EventType.HOVER,{id:n._hoverId},n,t))},n._handleError=function(t){n.options.verbose&&console.warn(t)},n._handleHighlightClick=function(t){var e=t.target;if(v.isHighlightWrapNode(e)){var r=v.getHighlightId(e,n.options.$root);n.emit(m.EventType.CLICK,{id:r},n,t)}},n.options=g.getDefaultOptions(),n.hooks=n._getHooks(),n.setOption(e),n.cache=new u.default;var r=n.options.$root;return v.addEventListener(r,n.event.PointerOver,n._handleHighlightHover),v.addEventListener(r,n.event.PointerTap,n._handleHighlightClick),g.eventEmitter.on(g.INTERNAL_ERROR_EVENT,n._handleError),n}return i(e,t),e.prototype.remove=function(t){if(t){var e=this.painter.removeHighlight(t);this.cache.remove(t),e&&this.emit(m.EventType.REMOVE,{ids:[t]},this)}},e.prototype.removeAll=function(){this.painter.removeAllHighlight();var t=this.cache.removeAll();this.emit(m.EventType.REMOVE,{ids:t},this)},e.prototype._highlightFromHSource=function(t){void 0===t&&(t=[]);var e=this.painter.highlightSource(t);this.emit(m.EventType.CREATE,{sources:e,type:m.CreateFrom.STORE},this),this.cache.save(t)},e.event=m.EventType,e.isHighlightWrapNode=v.isHighlightWrapNode,e.isHighlightSource=function(t){return!!t.__isHighlightSource},e}(l.default);e.default=y},function(t,e,n){var r=n(0);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){var r=n(34),i=n(16);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(16);t.exports=function(t){return Object(r(t))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInputEvent=e.SelectedNodeType=e.CreateFrom=e.EventType=e.ERROR=e.SplitType=void 0,function(t){t.none="none",t.head="head",t.tail="tail",t.both="both"}(e.SplitType||(e.SplitType={})),function(t){t.DOM_TYPE_ERROR="[DOM] Receive wrong node type.",t.DOM_SELECTION_EMPTY="[DOM] The selection contains no dom node, may be you except them.",t.RANGE_INVALID="[RANGE] Got invalid dom range, can't convert to a valid highlight range.",t.RANGE_NODE_INVALID="[RANGE] Start or end node isn't a text node, it may occur an error.",t.DB_ID_DUPLICATE_ERROR="[STORE] Unique id conflict.",t.CACHE_SET_ERROR="[CACHE] Cache.data can't be set manually, please use .save().",t.SOURCE_TYPE_ERROR="[SOURCE] Object isn't a highlight source instance.",t.HIGHLIGHT_RANGE_FROZEN="[HIGHLIGHT_RANGE] A highlight range must be frozen before render.",t.HIGHLIGHT_SOURCE_RECREATE="[HIGHLIGHT_SOURCE] Recreate highlights from sources error.",t.HIGHLIGHT_SOURCE_NONE_RENDER="[HIGHLIGHT_SOURCE] This highlight source isn't rendered. May be the exception skips it or the dom structure has changed."}(e.ERROR||(e.ERROR={})),function(t){t.CREATE="selection:create",t.REMOVE="selection:remove",t.MODIFY="selection:modify",t.HOVER="selection:hover",t.HOVER_OUT="selection:hover-out",t.CLICK="selection:click"}(e.EventType||(e.EventType={})),function(t){t.STORE="from-store",t.INPUT="from-input"}(e.CreateFrom||(e.CreateFrom={})),function(t){t.text="text",t.span="span"}(e.SelectedNodeType||(e.SelectedNodeType={})),function(t){t.touchend="touchend",t.mouseup="mouseup",t.touchstart="touchstart",t.click="click",t.mouseover="mouseover"}(e.UserInputEvent||(e.UserInputEvent={}))},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(1),i=n(5),o=n(3),a=n(35),l=n(56),f=n(20),d=f.get,s=f.enforce,c=String(String).split("String");(t.exports=function(t,e,n,l){var f,d=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,u=!!l&&!!l.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),(f=s(n)).source||(f.source=c.join("string"==typeof e?e:""))),t!==r?(d?!u&&t[e]&&(h=!0):delete t[e],h?t[e]=n:i(t,e,n)):h?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&d(this).source||l(this)}))},function(t,e,n){var r,i,o,a=n(95),l=n(1),f=n(6),d=n(5),s=n(3),c=n(36),h=n(23),u=n(26),p=l.WeakMap;if(a||c.state){var g=c.state||(c.state=new p),m=g.get,v=g.has,y=g.set;r=function(t,e){if(v.call(g,t))throw new TypeError("Object already initialized");return e.facade=t,y.call(g,t,e),e},i=function(t){return m.call(g,t)||{}},o=function(t){return v.call(g,t)}}else{var b=h("state");u[b]=!0,r=function(t,e){if(s(t,b))throw new TypeError("Object already initialized");return e.facade=t,d(t,b,e),e},i=function(t){return s(t,b)?t[b]:{}},o=function(t){return s(t,b)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!f(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(14),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(24),i=n(37),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){var r=n(25),i=n(36);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.1",mode:r?"pure":"global",copyright:"ÂĐ 2021 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=!1},function(t,e){t.exports={}},function(t,e,n){var r=n(58),i=n(1),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t])||o(i[t]):r[t]&&r[t][e]||i[t]&&i[t][e]}},function(t,e,n){var r,i=n(9),o=n(100),a=n(39),l=n(26),f=n(101),d=n(55),s=n(23),c=s("IE_PROTO"),h=function(){},u=function(t){return"<script>"+t+"<\/script>"},p=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;p=r?function(t){t.write(u("")),t.close();var e=t.parentWindow.Object;return t=null,e}(r):((e=d("iframe")).style.display="none",f.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(u("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete p.prototype[a[n]];return p()};l[c]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=i(t),n=new h,h.prototype=null,n[c]=t):n=p(),void 0===e?n:o(n,e)}},function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this.handlersMap=Object.create(null)}return t.prototype.on=function(t,e){return this.handlersMap[t]||(this.handlersMap[t]=[]),this.handlersMap[t].push(e),this},t.prototype.off=function(t,e){return this.handlersMap[t]&&this.handlersMap[t].splice(this.handlersMap[t].indexOf(e)>>>0,1),this},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.handlersMap[t]&&this.handlersMap[t].slice().forEach((function(t){t.apply(void 0,i(e))})),this},t}();e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(50)),o=n(81),a=function(){function t(t,e,n,r,i){this.startMeta=t,this.endMeta=e,this.text=n,this.id=r,this.__isHighlightSource={},i&&(this.extra=i)}return t.prototype.deSerialize=function(t,e){var n=o.queryElementNode(this,t),r=n.start,a=n.end,l=o.getTextChildByOffset(r,this.startMeta.textOffset),f=o.getTextChildByOffset(a,this.endMeta.textOffset);if(!e.Serialize.Restore.isEmpty()){var d=e.Serialize.Restore.call(this,l,f)||[];l=d[0]||l,f=d[1]||f}return new i.default(l,f,this.text,this.id,!0)},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0}),e.hasClass=e.removeAllClass=e.removeClass=e.addClass=e.addEventListener=e.removeEventListener=e.forEach=e.getHighlightById=e.getHighlightsByRoot=e.getExtraHighlightId=e.getHighlightId=e.isHighlightWrapNode=void 0;var a=n(8);e.isHighlightWrapNode=function(t){return!!t.dataset&&!!t.dataset[a.CAMEL_DATASET_IDENTIFIER]};var l=function(t,n){for(var r=!1,i=null;t;){if(e.isHighlightWrapNode(t)&&(i=t),t===n){r=!0;break}t=t.parentNode}return r?i:null};e.getHighlightId=function(t,e){return(t=l(t,e))?t.dataset[a.CAMEL_DATASET_IDENTIFIER]:""};e.getExtraHighlightId=function(t,e){return(t=l(t,e))?t.dataset[a.CAMEL_DATASET_IDENTIFIER_EXTRA].split(a.ID_DIVISION).filter((function(t){return t})):[]};e.getHighlightsByRoot=function(t,e){var n,i;Array.isArray(t)||(t=[t]);var o=[];try{for(var l=r(t),f=l.next();!f.done;f=l.next()){var d=f.value.querySelectorAll(e+"[data-"+a.DATASET_IDENTIFIER+"]");o.push.apply(o,d)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return o};e.getHighlightById=function(t,e,n){var i,o,l=[],f=new RegExp("("+e+"\\"+a.ID_DIVISION+"|\\"+a.ID_DIVISION+"?"+e+"$)"),d=t.querySelectorAll(n+"[data-"+a.DATASET_IDENTIFIER+"]");try{for(var s=r(d),c=s.next();!c.done;c=s.next()){var h=c.value;if(h.dataset[a.CAMEL_DATASET_IDENTIFIER]!==e){var u=h.dataset[a.CAMEL_DATASET_IDENTIFIER_EXTRA];f.test(u)&&l.push(h)}else l.push(h)}}catch(t){i={error:t}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return l};e.forEach=function(t,e){for(var n=0;n<t.length;n++)e(t[n],n,t)};e.removeEventListener=function(t,e,n){t.removeEventListener(e,n)};e.addEventListener=function(t,n,r){return t.addEventListener(n,r),function(){e.removeEventListener(t,n,r)}};e.addClass=function(t,e){var n;Array.isArray(e)||(e=[e]),(n=t.classList).add.apply(n,o(e))};e.removeClass=function(t,e){t.classList.remove(e)};e.removeAllClass=function(t){t.className=""};e.hasClass=function(t,e){return t.classList.contains(e)}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){var r=n(11),i=n(53),o=n(17),a=n(12),l=n(22),f=n(3),d=n(54),s=Object.getOwnPropertyDescriptor;e.f=r?s:function(t,e){if(t=a(t),e=l(e,!0),d)try{return s(t,e)}catch(t){}if(f(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var r=n(0),i=n(18),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},function(t,e,n){var r=n(1),i=n(5);t.exports=function(t,e){try{i(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(1),i=n(35),o=r["__core-js_shared__"]||i("__core-js_shared__",{});t.exports=o},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e,n){var r=n(59),i=n(39).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(41),i=n(0);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},function(t,e,n){var r,i,o=n(1),a=n(99),l=o.process,f=l&&l.versions,d=f&&f.v8;d?i=(r=d.split("."))[0]<4?1:r[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),t.exports=i&&+i},function(t,e,n){var r=n(18);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(7).f,i=n(3),o=n(2)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(103),i=n(34),o=n(13),a=n(21),l=n(45),f=[].push,d=function(t){var e=1==t,n=2==t,d=3==t,s=4==t,c=6==t,h=7==t,u=5==t||c;return function(p,g,m,v){for(var y,b,w=o(p),x=i(w),E=r(g,m,3),T=a(x.length),k=0,I=v||l,_=e?I(p,T):n||h?I(p,0):void 0;T>k;k++)if((u||k in x)&&(b=E(y=x[k],k,w),t))if(e)_[k]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return k;case 2:f.call(_,y)}else switch(t){case 4:return!1;case 7:f.call(_,y)}return c?-1:d||s?s:_}};t.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterOut:d(7)}},function(t,e,n){var r=n(6),i=n(42),o=n(2)("species");t.exports=function(t,e){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){var r={};r[n(2)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e){t.exports={}},function(t,e,n){var r=n(0),i=n(2),o=n(41),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,n){"use strict";var r,i,o=n(125),a=n(126),l=n(24),f=n(28),d=n(20).get,s=n(127),c=n(128),h=RegExp.prototype.exec,u=l("native-string-replace",String.prototype.replace),p=h,g=(r=/a/,i=/b*/g,h.call(r,"a"),h.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),m=a.UNSUPPORTED_Y||a.BROKEN_CARET,v=void 0!==/()??/.exec("")[1];(g||v||m||s||c)&&(p=function(t){var e,n,r,i,a,l,s,c=this,y=d(c),b=y.raw;if(b)return b.lastIndex=c.lastIndex,e=p.call(b,t),c.lastIndex=b.lastIndex,e;var w=y.groups,x=m&&c.sticky,E=o.call(c),T=c.source,k=0,I=t;if(x&&(-1===(E=E.replace("y","")).indexOf("g")&&(E+="g"),I=String(t).slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==t[c.lastIndex-1])&&(T="(?: "+T+")",I=" "+I,k++),n=new RegExp("^(?:"+T+")",E)),v&&(n=new RegExp("^"+T+"$(?!\\s)",E)),g&&(r=c.lastIndex),i=h.call(x?n:c,I),x?i?(i.input=i.input.slice(k),i[0]=i[0].slice(k),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:g&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),v&&i&&i.length>1&&u.call(i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&w)for(i.groups=l=f(null),a=0;a<w.length;a++)l[(s=w[a])[0]]=i[s[1]];return i}),t.exports=p},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(30)),o=n(15),a=n(83),l=r(n(51)),f=n(84),d=n(8),s=function(){function t(t,e,n,r,i){void 0===i&&(i=!1),3===t.$node.nodeType&&3===e.$node.nodeType||d.eventEmitter.emit(d.INTERNAL_ERROR_EVENT,{type:o.ERROR.RANGE_NODE_INVALID}),this.start=f.formatDomNode(t),this.end=f.formatDomNode(e),this.text=n,this.frozen=i,this.id=r}return t.fromSelection=function(e){var n=a.getDomRange();if(!n)return null;var r={$node:n.startContainer,offset:n.startOffset},i={$node:n.endContainer,offset:n.endOffset},o=n.toString(),f=e.call(r,i,o);return new t(r,i,o,f=null!=f?f:l.default())},t.prototype.serialize=function(t,e){var n,r=f.getDomMeta(this.start.$node,this.start.offset,t),o=f.getDomMeta(this.end.$node,this.end.offset,t);return e.Serialize.RecordInfo.isEmpty()||(n=e.Serialize.RecordInfo.call(this.start,this.end,t)),this.frozen=!0,new i.default(r,o,this.text,this.id,n)},t.removeDomRange=a.removeSelection,t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}},function(t,e,n){var r=n(1),i=n(72),o=n(116),a=n(5);for(var l in i){var f=r[l],d=f&&f.prototype;if(d&&d.forEach!==o)try{a(d,"forEach",o)}catch(t){d.forEach=o}}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(11),i=n(0),o=n(55);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(1),i=n(6),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){var r=n(36),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return i.call(t)}),t.exports=r.inspectSource},function(t,e,n){var r=n(3),i=n(96),o=n(33),a=n(7);t.exports=function(t,e){for(var n=i(e),l=a.f,f=o.f,d=0;d<n.length;d++){var s=n[d];r(t,s)||l(t,s,f(e,s))}}},function(t,e,n){var r=n(1);t.exports=r},function(t,e,n){var r=n(3),i=n(12),o=n(97).indexOf,a=n(26);t.exports=function(t,e){var n,l=i(t),f=0,d=[];for(n in l)!r(a,n)&&r(l,n)&&d.push(n);for(;e.length>f;)r(l,n=e[f++])&&(~o(d,n)||d.push(n));return d}},function(t,e,n){var r=n(14),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(40);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(59),i=n(39);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(2);e.f=r},function(t,e,n){var r=n(58),i=n(3),o=n(64),a=n(7).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){var r=n(46),i=n(19),o=n(106);r||i(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){"use strict";var r=n(12),i=n(109),o=n(47),a=n(20),l=n(68),f=a.set,d=a.getterFor("Array Iterator");t.exports=l(Array,"Array",(function(t,e){f(this,{type:"Array Iterator",target:r(t),index:0,kind:e})}),(function(){var t=d(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){"use strict";var r=n(4),i=n(110),o=n(70),a=n(112),l=n(43),f=n(5),d=n(19),s=n(2),c=n(25),h=n(47),u=n(69),p=u.IteratorPrototype,g=u.BUGGY_SAFARI_ITERATORS,m=s("iterator"),v=function(){return this};t.exports=function(t,e,n,s,u,y,b){i(n,e,s);var w,x,E,T=function(t){if(t===u&&A)return A;if(!g&&t in _)return _[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",I=!1,_=t.prototype,S=_[m]||_["@@iterator"]||u&&_[u],A=!g&&S||T(u),R="Array"==e&&_.entries||S;if(R&&(w=o(R.call(new t)),p!==Object.prototype&&w.next&&(c||o(w)===p||(a?a(w,p):"function"!=typeof w[m]&&f(w,m,v)),l(w,k,!0,!0),c&&(h[k]=v))),"values"==u&&S&&"values"!==S.name&&(I=!0,A=function(){return S.call(this)}),c&&!b||_[m]===A||f(_,m,A),h[e]=A,u)if(x={values:T("values"),keys:y?A:T("keys"),entries:T("entries")},b)for(E in x)(g||I||!(E in _))&&d(_,E,x[E]);else r({target:e,proto:!0,forced:g||I},x);return x}},function(t,e,n){"use strict";var r,i,o,a=n(0),l=n(70),f=n(5),d=n(3),s=n(2),c=n(25),h=s("iterator"),u=!1;[].keys&&("next"in(o=[].keys())?(i=l(l(o)))!==Object.prototype&&(r=i):u=!0);var p=null==r||a((function(){var t={};return r[h].call(t)!==t}));p&&(r={}),c&&!p||d(r,h)||f(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:u}},function(t,e,n){var r=n(3),i=n(13),o=n(23),a=n(111),l=o("IE_PROTO"),f=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=i(t),r(t,l)?t[l]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?f:null}},function(t,e,n){var r=n(14),i=n(16),o=function(t){return function(e,n){var o,a,l=String(i(e)),f=r(n),d=l.length;return f<0||f>=d?t?"":void 0:(o=l.charCodeAt(f))<55296||o>56319||f+1===d||(a=l.charCodeAt(f+1))<56320||a>57343?t?l.charAt(f):o:t?l.slice(f,f+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){throw 1},1)}))}},function(t,e,n){"use strict";var r=n(4),i=n(44).map;r({target:"Array",proto:!0,forced:!n(48)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";n.r(e),function(t){n(66),n(122),n(74),n(123);t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(o).concat([i]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}}.call(this,n(32)(t))},function(t,e,n){"use strict";var r=n(22),i=n(7),o=n(17);t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},function(t,e,n){var r,i,o={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),l=function(t,e){return e?e.querySelector(t):document.querySelector(t)},f=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=l.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),d=null,s=0,c=[],h=n(124);function u(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=o[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(b(r.parts[a],e))}else{var l=[];for(a=0;a<r.parts.length;a++)l.push(b(r.parts[a],e));o[r.id]={id:r.id,refs:1,parts:l}}}}function p(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=e.base?o[0]+e.base:o[0],l={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function g(t,e){var n=f(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=f(t.insertAt.before,n);n.insertBefore(e,i)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),g(t,e),e}function y(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function b(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=s++;n=d||(d=v(e)),r=E.bind(null,n,a,!1),i=E.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),g(t,e),e}(e),r=k.bind(null,n,e),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=T.bind(null,n),i=function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=p(t,e);return u(n,e),function(t){for(var r=[],i=0;i<n.length;i++){var a=n[i];(l=o[a.id]).refs--,r.push(l)}t&&u(p(t,e),e);for(i=0;i<r.length;i++){var l;if(0===(l=r[i]).refs){for(var f=0;f<l.parts.length;f++)l.parts[f]();delete o[l.id]}}}};var w,x=(w=[],function(t,e){return w[t]=e,w.filter(Boolean).join("\n")});function E(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function T(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function k(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=h(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),l=t.href;t.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}},function(t,e,n){"use strict";var r=n(4),i=n(49);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(t,e){t.exports="\t\n\v\f\r              â€Ŋ  \u2028\u2029\ufeff"},function(t,e,n){n(10),t.exports=n(140)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.queryElementNode=e.getTextChildByOffset=void 0;var r=n(8);e.getTextChildByOffset=function(t,e){for(var n=[t],r=null,i=0,o=0;r=n.pop();){for(var a=r.childNodes,l=a.length-1;l>=0;l--)n.push(a[l]);if(3===r.nodeType&&(o=e-i,(i+=r.textContent.length)>=e))break}return r||(r=t),{$node:r,offset:o}};e.queryElementNode=function(t,e){return{start:t.startMeta.parentIndex===r.ROOT_IDX?e:e.getElementsByTagName(t.startMeta.parentTagName)[t.startMeta.parentIndex],end:t.endMeta.parentIndex===r.ROOT_IDX?e:e.getElementsByTagName(t.endMeta.parentTagName)[t.endMeta.parentIndex]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.split("-").reduce((function(t,e,n){return t+(0===n?e:e[0].toUpperCase()+e.slice(1))}),"")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeSelection=e.getDomRange=void 0;e.getDomRange=function(){var t=window.getSelection();return t.isCollapsed?(console.debug("no text selected"),null):t.getRangeAt(0)};e.removeSelection=function(){window.getSelection().removeAllRanges()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatDomNode=e.getDomMeta=void 0;var r=n(8);e.getDomMeta=function(t,e,n){var i=function(t){if(t instanceof HTMLElement&&(!t.dataset||!t.dataset[r.CAMEL_DATASET_IDENTIFIER]))return t;for(var e=t.parentNode;null==e?void 0:e.dataset[r.CAMEL_DATASET_IDENTIFIER];)e=e.parentNode;return e}(t),o=i===n?r.ROOT_IDX:function(t,e){for(var n=t.tagName,i=e.getElementsByTagName(n),o=0;o<i.length;o++)if(t===i[o])return o;return r.UNKNOWN_IDX}(i,n),a=function(t,e){for(var n=[t],r=null,i=0;r=n.pop();){for(var o=r.childNodes,a=o.length-1;a>=0;a--)n.push(o[a]);if(3===r.nodeType&&r!==e)i+=r.textContent.length;else if(3===r.nodeType)break}return i}(i,t);return{parentTagName:i.tagName,parentIndex:o,textOffset:a+e}};e.formatDomNode=function(t){return 3===t.$node.nodeType||4===t.$node.nodeType||8===t.$node.nodeType?t:{$node:t.$node.childNodes[t.offset],offset:0}}},function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.name="",this.ops=[],this.name=t}return t.prototype.tap=function(t){var e=this;return this.ops.includes(t)||this.ops.push(t),function(){e.remove(t)}},t.prototype.remove=function(t){var e=this.ops.indexOf(t);e<0||this.ops.splice(e,1)},t.prototype.isEmpty=function(){return 0===this.ops.length},t.prototype.call=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.ops.forEach((function(n){t=n.apply(void 0,i(e))})),t},t}();e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),o=r(n(87));e.default=function(){var t=o.default(window.navigator.userAgent);return{PointerEnd:t?i.UserInputEvent.touchend:i.UserInputEvent.mouseup,PointerTap:t?i.UserInputEvent.touchstart:i.UserInputEvent.click,PointerOver:t?i.UserInputEvent.touchstart:i.UserInputEvent.mouseover}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=/Android|iPhone|BlackBerry|BB10|Opera Mini|Phone|Mobile|Silk|Windows Phone|Mobile(?:.+)Firefox\b/i;e.default=function(t){return r.test(t)}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=a(n(29)),f=n(15),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._data=new Map,e}return i(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.getAll()},set:function(t){throw f.ERROR.CACHE_SET_ERROR},enumerable:!1,configurable:!0}),e.prototype.save=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e._data.set(t.id,t)})):this._data.set(t.id,t)},e.prototype.get=function(t){return this._data.get(t)},e.prototype.remove=function(t){this._data.delete(t)},e.prototype.getAll=function(){var t,e,n=[];try{for(var r=o(this._data),i=r.next();!i.done;i=r.next()){var a=i.value;n.push(a[1])}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},e.prototype.removeAll=function(){var t,e,n=[];try{for(var r=o(this._data),i=r.next();!i.done;i=r.next()){var a=i.value;n.push(a[0])}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return this._data=new Map,n},e}(l.default);e.default=d},function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=a(n(30)),f=n(90),d=n(31),s=n(15),c=n(92),h=n(8),u=function(){function t(t,e){this.options={$root:t.$root,wrapTag:t.wrapTag,exceptSelectors:t.exceptSelectors,className:t.className},this.hooks=e,c.initDefaultStylesheet()}return t.prototype.highlightRange=function(t){var e=this;if(!t.frozen)throw s.ERROR.HIGHLIGHT_RANGE_FROZEN;var n=this.options,r=n.$root,i=n.className,o=n.exceptSelectors,a=this.hooks,l=f.getSelectedNodes(r,t.start,t.end,o);return a.Render.SelectedNodes.isEmpty()||(l=a.Render.SelectedNodes.call(t.id,l)||[]),l.map((function(n){var r=f.wrapHighlight(n,t,i,e.options.wrapTag);return a.Render.WrapNode.isEmpty()||(r=a.Render.WrapNode.call(t.id,r)),r}))},t.prototype.highlightSource=function(t){var e=this,n=Array.isArray(t)?t:[t],r=[];return n.forEach((function(t){if(t instanceof l.default){var n=t.deSerialize(e.options.$root,e.hooks);e.highlightRange(n).length>0?r.push(t):h.eventEmitter.emit(h.INTERNAL_ERROR_EVENT,{type:s.ERROR.HIGHLIGHT_SOURCE_NONE_RENDER,detail:t})}else h.eventEmitter.emit(h.INTERNAL_ERROR_EVENT,{type:s.ERROR.SOURCE_TYPE_ERROR})})),r},t.prototype.removeHighlight=function(t){var e,n,i=new RegExp("("+t+"\\"+h.ID_DIVISION+"|\\"+h.ID_DIVISION+"?"+t+"$)"),a=this.hooks,l=this.options.wrapTag,s=document.querySelectorAll(l+"[data-"+h.DATASET_IDENTIFIER+"]"),c=[],u=[],p=[];try{for(var g=r(s),m=g.next();!m.done;m=g.next()){var v=m.value,y=v.dataset[h.CAMEL_DATASET_IDENTIFIER],b=v.dataset[h.CAMEL_DATASET_IDENTIFIER_EXTRA];y!==t||b?y===t?u.push(v):y!==t&&i.test(b)&&p.push(v):c.push(v)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=g.return)&&n.call(g)}finally{if(e)throw e.error}}return c.forEach((function(e){var n=e.parentNode,r=document.createDocumentFragment();d.forEach(e.childNodes,(function(t){return r.appendChild(t.cloneNode(!1))}));var i=e.previousSibling,o=e.nextSibling;n.replaceChild(r,e),f.normalizeSiblingText(i,!0),f.normalizeSiblingText(o,!1),a.Remove.UpdateNodes.call(t,e,"remove")})),u.forEach((function(e){var n=e.dataset,r=n[h.CAMEL_DATASET_IDENTIFIER_EXTRA].split(h.ID_DIVISION),i=r.shift(),f=document.querySelector(l+"[data-"+h.DATASET_IDENTIFIER+'="'+i+'"]');f&&(d.removeAllClass(e),d.addClass(e,o(f.classList))),n[h.CAMEL_DATASET_IDENTIFIER]=i,n[h.CAMEL_DATASET_IDENTIFIER_EXTRA]=r.join(h.ID_DIVISION),a.Remove.UpdateNodes.call(t,e,"id-update")})),p.forEach((function(e){var n=e.dataset[h.CAMEL_DATASET_IDENTIFIER_EXTRA];e.dataset[h.CAMEL_DATASET_IDENTIFIER_EXTRA]=n.replace(i,""),a.Remove.UpdateNodes.call(t,e,"extra-update")})),c.length+u.length+p.length!==0},t.prototype.removeAllHighlight=function(){var t=this.options,e=t.wrapTag,n=t.$root;d.getHighlightsByRoot(n,e).forEach((function(t){var e=t.parentNode,n=document.createDocumentFragment();d.forEach(t.childNodes,(function(t){return n.appendChild(t.cloneNode(!1))})),e.replaceChild(n,t)}))},t}();e.default=u},function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeSiblingText=e.wrapHighlight=e.getSelectedNodes=void 0;var o=n(15),a=n(31),l=n(8),f=n(91),d=function(t,e){if(!t)return!1;if(e.startsWith(".")){var n=e.replace(/^\./,"");return t&&a.hasClass(t,n)}if(e.startsWith("#")){var r=e.replace(/^#/,"");return t&&t.id===r}var i=e.toUpperCase();return t&&t.tagName===i};e.getSelectedNodes=function(t,e,n,r){var i=e.$node,a=n.$node,l=e.offset,f=n.offset;if(i===a&&i instanceof Text)return function(t,e,n,r){for(var i=t,a=function(t){return null==r?void 0:r.some((function(e){return d(t,e)}))};i;){if(1===i.nodeType&&a(i))return[];i=i.parentNode}t.splitText(e);var l=t.nextSibling;return l.splitText(n-e),[{$node:l,type:o.SelectedNodeType.text,splitType:o.SplitType.both}]}(i,l,f,r);for(var s=[t],c=[],h=function(t){return null==r?void 0:r.some((function(e){return d(t,e)}))},u=!1,p=null;p=s.pop();)if(1!==p.nodeType||!h(p)){for(var g=p.childNodes,m=g.length-1;m>=0;m--)s.push(g[m]);if(p===i){if(3===p.nodeType){p.splitText(l);var v=p.nextSibling;c.push({$node:v,type:o.SelectedNodeType.text,splitType:o.SplitType.head})}u=!0}else{if(p===a){if(3===p.nodeType)(v=p).splitText(f),c.push({$node:v,type:o.SelectedNodeType.text,splitType:o.SplitType.tail});break}u&&3===p.nodeType&&c.push({$node:p,type:o.SelectedNodeType.text,splitType:o.SplitType.none})}}return c};var s=function(t,e){var n=Array.isArray(e)?e:[e];return(n=0===n.length?[l.getDefaultOptions().style.className]:n).forEach((function(e){a.addClass(t,e)})),t},c=function(t){return!t||!t.textContent};e.wrapHighlight=function(t,e,n,r){var d=t.$node.parentNode,h=t.$node.previousSibling,u=t.$node.nextSibling;return a.isHighlightWrapNode(d)?!a.isHighlightWrapNode(d)||c(h)&&c(u)?function(t,e,n){var r=t.$node.parentNode,i=r;a.removeAllClass(i),s(i,n);var o=r.dataset,f=o[l.CAMEL_DATASET_IDENTIFIER];return o[l.CAMEL_DATASET_IDENTIFIER]=e.id,o[l.CAMEL_DATASET_IDENTIFIER_EXTRA]=o[l.CAMEL_DATASET_IDENTIFIER_EXTRA]?f+l.ID_DIVISION+o[l.CAMEL_DATASET_IDENTIFIER_EXTRA]:f,i}(t,e,n):function(t,e,n,r){var a=document.createElement(r),d=t.$node.parentNode,c=t.$node.previousSibling,h=t.$node.nextSibling,u=document.createDocumentFragment(),p=d.dataset[l.CAMEL_DATASET_IDENTIFIER],g=d.dataset[l.CAMEL_DATASET_IDENTIFIER_EXTRA],m=g?p+l.ID_DIVISION+g:p;a.setAttribute("data-"+l.DATASET_IDENTIFIER,e.id),a.setAttribute("data-"+l.DATASET_IDENTIFIER_EXTRA,m),a.appendChild(t.$node.cloneNode(!1));var v,y=!1,b=!1;c&&((w=d.cloneNode(!1)).textContent=c.textContent,u.appendChild(w),y=!0);var w,x=[];(Array.isArray(n)?x.push.apply(x,i(n)):x.push(n),s(a,f.unique(x)),u.appendChild(a),h)&&((w=d.cloneNode(!1)).textContent=h.textContent,u.appendChild(w),b=!0);return v=y&&b?o.SplitType.both:y?o.SplitType.head:b?o.SplitType.tail:o.SplitType.none,a.setAttribute("data-"+l.DATASET_SPLIT_TYPE,v),d.parentNode.replaceChild(u,d),a}(t,e,n,r):function(t,e,n,r){var i=document.createElement(r);return s(i,n),i.appendChild(t.$node.cloneNode(!1)),t.$node.parentNode.replaceChild(i,t.$node),i.setAttribute("data-"+l.DATASET_IDENTIFIER,e.id),i.setAttribute("data-"+l.DATASET_SPLIT_TYPE,t.splitType),i.setAttribute("data-"+l.DATASET_IDENTIFIER_EXTRA,""),i}(t,e,n,r)};e.normalizeSiblingText=function(t,e){if(void 0===e&&(e=!0),t&&3===t.nodeType){var n=e?t.nextSibling:t.previousSibling;if(3===n.nodeType){var r=n.nodeValue;t.nodeValue=e?t.nodeValue+r:r+t.nodeValue,n.parentNode.removeChild(n)}}}},function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.unique=void 0;e.unique=function(t){var e,n,i=[];try{for(var o=r(t),a=o.next();!a.done;a=o.next()){var l=a.value;i.includes(l)||i.push(l)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initDefaultStylesheet=void 0;var r=n(8);e.initDefaultStylesheet=function(){var t=r.STYLESHEET_ID,e=document.getElementById(t);if(!e){var n=document.createTextNode(r.getStylesheet());(e=document.createElement("style")).id=t,e.appendChild(n),document.head.appendChild(e)}return e}