Home
last modified time | relevance | path

Searched refs:pv (Results 1 – 25 of 29) sorted by relevance

12

/plugin/freechat/phpfreechat/src/commands/
H A Dupdate.class.php50 foreach( $u->privmsg as $id => $pv )
52 $cmdp["recipient"] = $pv["recipient"];
66 foreach( $u->privmsg as $id => $pv )
68 $cmdp["recipient"] = $pv["recipient"];
H A Dnick.class.php62 foreach( $u->privmsg as $id => $pv )
64 $cmdp["recipient"] = $pv["recipient"];
H A Dconnect.class.php122 foreach($u->privmsg as $recipientid2 => $pv)
124 $recipient2 = $pv['recipient'];
/plugin/pgn4web/pgn4web/
H A Dparsing-tests.js30 function testRandomMoves(nn, pv, pg) { argument
34 if (typeof(pv) == "undefined") { pv = 0.5; }
45 if (Math.random() < pv) {
H A Dpgn-standard.txt2254 requirements for the operands. For example, the "pv" (predicted variation)
2526 If a non-empty "pv" (predicted variation) line of play is also present in the
2533 16.2.5.19: Opcode "pv": predicted variation
2535 The "pv" opcode is used to provide a predicted variation for the indicated
/plugin/progrecss/
H A Dsyntax.php220 function _place_percentage ($pv, $p, $where) { argument
222 $wt.= ' <span class="bar '. $where. '" style="width: '.$pv. '%;">';
/plugin/swfobject/
H A Dscript.js4pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.rea…
/plugin/diagramsnet/lib/js/diagramly/
H A DEditor.js8149 if (pv == null)
8152 pv.pageSelector = false;
8153 pv.mathEnabled = false;
8286 if (pv.wnd != null)
8321 return pv;
8327 var pv = null;
8420 pv = printGraph(tempGraph, pv, i != imax);
8430 pv = printGraph(graph);
8433 if (pv == null)
8439 if (pv.mathEnabled)
[all …]
H A DPages.js574 var pv = node.getAttribute('page');
605 …pageVisible: (this.isLightboxView()) ? false : ((pv != null) ? (pv != '0') : this.defaultPageVisib…
/plugin/chat/
H A Dreadme.txt30 [[http://pv.no-ip.org/bin/dokuwiki-chat-1.1.2.zip|Mirror 1 here]] (version 1.1.2), or \\
/plugin/diagramsnet/lib/js/grapheditor/
H A DEditor.js493 var pv = node.getAttribute('page');
495 if (pv != null)
497 this.graph.pageVisible = (pv != '0');
/plugin/dw2pdf/vendor/mpdf/mpdf/src/
H A DOtlDump.php3396 for ($pv = 0; $pv < $PairValueCount; $pv++) {
H A DOtl.php3345 for ($pv = 0; $pv < $PairValueCount; $pv++) {
/plugin/bpmnioeditor/vendor/bpmnio-js/
H A Dbpmn-modeler.production.min.js34pv="djs-dragging",uv="drop-ok",lv="drop-not-ok",hv="new-parent",dv="attach-ok";function fv(e,t,n,i…
/plugin/diagramsnet/lib/WEB-INF/lib/
H A Dehcache-3.8.1.jarMETA-INF/ META-INF/MANIFEST.MF LICENSE META-INF/maven/ META ...
/plugin/flowcharts/
H A Dmermaid.min.js1pv=Ly((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){retu…
/plugin/combo/resources/library/rrdiagram/0.9.4.1/
H A Drrdiagram.js.map1 {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 584aa1e0b3855d207932","webpack:///rrdiagram.js","webpack:///../~/core-js/modules/_export.js","webpack:///../~/core-js/modules/_an-object.js","webpack:///../~/core-js/modules/_global.js","webpack:///../~/core-js/modules/_fails.js","webpack:///../~/core-js/modules/_is-object.js","webpack:///../~/core-js/modules/_wks.js","webpack:///../~/core-js/modules/_to-length.js","webpack:///../~/core-js/modules/_descriptors.js","webpack:///../~/core-js/modules/_object-dp.js","webpack:///../~/core-js/modules/_to-object.js","webpack:///../~/core-js/modules/_a-function.js","webpack:///./ui/rrelement.js","webpack:///../~/core-js/modules/_hide.js","webpack:///../~/core-js/modules/_redefine.js","webpack:///../~/core-js/modules/_string-html.js","webpack:///../~/core-js/modules/_has.js","webpack:///../~/core-js/modules/_object-gopd.js","webpack:///../~/core-js/modules/_object-gpo.js","webpack:///../~/core-js/modules/_to-iobject.js","webpack:///../~/core-js/modules/_cof.js","webpack:///../~/core-js/modules/_core.js","webpack:///../~/core-js/modules/_ctx.js","webpack:///../~/core-js/modules/_strict-method.js","webpack:///../~/core-js/modules/_to-integer.js","webpack:///./model/grammartobnf.js","webpack:///./model/grammartorrdiagram.js","webpack:///../~/core-js/modules/_array-methods.js","webpack:///../~/core-js/modules/_defined.js","webpack:///../~/core-js/modules/_object-sap.js","webpack:///../~/core-js/modules/_to-primitive.js","webpack:///../~/core-js/modules/_metadata.js","webpack:///../~/core-js/modules/_typed-array.js","webpack:///./model/expression.js","webpack:///../~/core-js/modules/_add-to-unscopables.js","webpack:///../~/core-js/modules/_library.js","webpack:///../~/core-js/modules/_meta.js","webpack:///../~/core-js/modules/_an-instance.js","webpack:///../~/core-js/modules/_for-of.js","webpack:///../~/core-js/modules/_object-create.js","webpack:///../~/core-js/modules/_object-gopn.js","webpack:///../~/core-js/modules/_object-keys.js","webpack:///../~/core-js/modules/_property-desc.js","webpack:///../~/core-js/modules/_redefine-all.js","webpack:///../~/core-js/modules/_set-species.js","webpack:///../~/core-js/modules/_to-absolute-index.js","webpack:///../~/core-js/modules/_uid.js","webpack:///../~/core-js/modules/_validate-collection.js","webpack:///../~/core-js/modules/_classof.js","webpack:///../~/core-js/modules/_iterators.js","webpack:///../~/core-js/modules/_set-to-string-tag.js","webpack:///../~/core-js/modules/_string-trim.js","webpack:///./ui/layoutinfo.js","webpack:///./ui/rrtext.js","webpack:///../~/core-js/modules/_flags.js","webpack:///../~/core-js/modules/_iobject.js","webpack:///../~/core-js/modules/_object-pie.js","webpack:///../~/core-js/modules/_shared.js","webpack:///../~/core-js/modules/_species-constructor.js","webpack:///./model/rule.js","webpack:///./ui/rrdiagram.js","webpack:///./ui/rrdiagramtosvg.js","webpack:///../~/core-js/modules/_array-includes.js","webpack:///../~/core-js/modules/_collection.js","webpack:///../~/core-js/modules/_fix-re-wks.js","webpack:///../~/core-js/modules/_is-array.js","webpack:///../~/core-js/modules/_is-regexp.js","webpack:///../~/core-js/modules/_iter-detect.js","webpack:///../~/core-js/modules/_object-forced-pam.js","webpack:///../~/core-js/modules/_object-gops.js","webpack:///../~/core-js/modules/_regexp-exec-abstract.js","webpack:///../~/core-js/modules/_set-collection-from.js","webpack:///../~/core-js/modules/_set-collection-of.js","webpack:///../~/core-js/modules/_string-at.js","webpack:///../~/core-js/modules/_typed.js","webpack:///../~/core-js/modules/_user-agent.js","webpack:///./model/grammar.js","webpack:///./model/literal.js","webpack:///./model/repetition.js","webpack:///./model/rulereference.js","webpack:///./model/sequence.js","webpack:///./ui/rrbreak.js","webpack:///./ui/rrchoice.js","webpack:///./ui/rrloop.js","webpack:///./ui/rrsequence.js","webpack:///./utils/utils.js","webpack:///../~/core-js/modules/_advance-string-index.js","webpack:///../~/core-js/modules/_array-fill.js","webpack:///../~/core-js/modules/_array-species-create.js","webpack:///../~/core-js/modules/_create-property.js","webpack:///../~/core-js/modules/_dom-create.js","webpack:///../~/core-js/modules/_enum-bug-keys.js","webpack:///../~/core-js/modules/_fails-is-regexp.js","webpack:///../~/core-js/modules/_html.js","webpack:///../~/core-js/modules/_inherit-if-required.js","webpack:///../~/core-js/modules/_is-array-iter.js","webpack:///../~/core-js/modules/_iter-create.js","webpack:///../~/core-js/modules/_iter-define.js","webpack:///../~/core-js/modules/_math-expm1.js","webpack:///../~/core-js/modules/_math-sign.js","webpack:///../~/core-js/modules/_microtask.js","webpack:///../~/core-js/modules/_new-promise-capability.js","webpack:///../~/core-js/modules/_regexp-exec.js","webpack:///../~/core-js/modules/_set-proto.js","webpack:///../~/core-js/modules/_shared-key.js","webpack:///../~/core-js/modules/_string-context.js","webpack:///../~/core-js/modules/_string-repeat.js","webpack:///../~/core-js/modules/_string-ws.js","webpack:///../~/core-js/modules/_task.js","webpack:///../~/core-js/modules/_typed-buffer.js","webpack:///../~/core-js/modules/_wks-define.js","webpack:///../~/core-js/modules/core.get-iterator-method.js","webpack:///../~/core-js/modules/es6.array.iterator.js","webpack:///./model/bnftogrammar.js","webpack:///./model/choice.js","webpack:///./model/specialsequence.js","webpack:///./ui/rrline.js","webpack:///../~/core-js/modules/_a-number-value.js","webpack:///../~/core-js/modules/_array-copy-within.js","webpack:///../~/core-js/modules/_array-from-iterable.js","webpack:///../~/core-js/modules/_array-reduce.js","webpack:///../~/core-js/modules/_bind.js","webpack:///../~/core-js/modules/_collection-strong.js","webpack:///../~/core-js/modules/_collection-to-json.js","webpack:///../~/core-js/modules/_collection-weak.js","webpack:///../~/core-js/modules/_flatten-into-array.js","webpack:///../~/core-js/modules/_ie8-dom-define.js","webpack:///../~/core-js/modules/_invoke.js","webpack:///../~/core-js/modules/_is-integer.js","webpack:///../~/core-js/modules/_iter-call.js","webpack:///../~/core-js/modules/_iter-step.js","webpack:///../~/core-js/modules/_math-fround.js","webpack:///../~/core-js/modules/_math-log1p.js","webpack:///../~/core-js/modules/_math-scale.js","webpack:///../~/core-js/modules/_object-assign.js","webpack:///../~/core-js/modules/_object-dps.js","webpack:///../~/core-js/modules/_object-gopn-ext.js","webpack:///../~/core-js/modules/_object-keys-internal.js","webpack:///../~/core-js/modules/_object-to-array.js","webpack:///../~/core-js/modules/_own-keys.js","webpack:///../~/core-js/modules/_parse-float.js","webpack:///../~/core-js/modules/_parse-int.js","webpack:///../~/core-js/modules/_perform.js","webpack:///../~/core-js/modules/_promise-resolve.js","webpack:///../~/core-js/modules/_same-value.js","webpack:///../~/core-js/modules/_string-pad.js","webpack:///../~/core-js/modules/_to-index.js","webpack:///../~/core-js/modules/_wks-ext.js","webpack:///../~/core-js/modules/es6.map.js","webpack:///../~/core-js/modules/es6.regexp.exec.js","webpack:///../~/core-js/modules/es6.regexp.flags.js","webpack:///../~/core-js/modules/es6.set.js","webpack:///../~/core-js/modules/es6.weak-map.js","webpack:///../~/webpack/buildin/global.js","webpack:///./main.js","webpack:///../~/babel-polyfill/lib/index.js","webpack:///./bnfdisplay/BNFDisplay.js","webpack:///./model/chunk.js","webpack:///./ui/svg/svgcontent.js","webpack:///./ui/svg/svgline.js","webpack:///./ui/svg/svgpath.js","webpack:///../~/core-js/fn/regexp/escape.js","webpack:///../~/core-js/modules/_array-species-constructor.js","webpack:///../~/core-js/modules/_date-to-iso-string.js","webpack:///../~/core-js/modules/_date-to-primitive.js","webpack:///../~/core-js/modules/_enum-keys.js","webpack:///../~/core-js/modules/_function-to-string.js","webpack:///../~/core-js/modules/_replacer.js","webpack:///../~/core-js/modules/core.regexp.escape.js","webpack:///../~/core-js/modules/es6.array.copy-within.js","webpack:///../~/core-js/modules/es6.array.every.js","webpack:///../~/core-js/modules/es6.array.fill.js","webpack:///../~/core-js/modules/es6.array.filter.js","webpack:///../~/core-js/modules/es6.array.find-index.js","webpack:///../~/core-js/modules/es6.array.find.js","webpack:///../~/core-js/modules/es6.array.for-each.js","webpack:///../~/core-js/modules/es6.array.from.js","webpack:///../~/core-js/modules/es6.array.index-of.js","webpack:///../~/core-js/modules/es6.array.is-array.js","webpack:///../~/core-js/modules/es6.array.join.js","webpack:///../~/core-js/modules/es6.array.last-index-of.js","webpack:///../~/core-js/modules/es6.array.map.js","webpack:///../~/core-js/modules/es6.array.of.js","webpack:///../~/core-js/modules/es6.array.reduce-right.js","webpack:///../~/core-js/modules/es6.array.reduce.js","webpack:///../~/core-js/modules/es6.array.slice.js","webpack:///../~/core-js/modules/es6.array.some.js","webpack:///../~/core-js/modules/es6.array.sort.js","webpack:///../~/core-js/modules/es6.array.species.js","webpack:///../~/core-js/modules/es6.date.now.js","webpack:///../~/core-js/modules/es6.date.to-iso-string.js","webpack:///../~/core-js/modules/es6.date.to-json.js","webpack:///../~/core-js/modules/es6.date.to-primitive.js","webpack:///../~/core-js/modules/es6.date.to-string.js","webpack:///../~/core-js/modules/es6.function.bind.js","webpack:///../~/core-js/modules/es6.function.has-instance.js","webpack:///../~/core-js/modules/es6.function.name.js","webpack:///../~/core-js/modules/es6.math.acosh.js","webpack:///../~/core-js/modules/es6.math.asinh.js","webpack:///../~/core-js/modules/es6.math.atanh.js","webpack:///../~/core-js/modules/es6.math.cbrt.js","webpack:///../~/core-js/modules/es6.math.clz32.js","webpack:///../~/core-js/modules/es6.math.cosh.js","webpack:///../~/core-js/modules/es6.math.expm1.js","webpack:///../~/core-js/modules/es6.math.fround.js","webpack:///../~/core-js/modules/es6.math.hypot.js","webpack:///../~/core-js/modules/es6.math.imul.js","webpack:///../~/core-js/modules/es6.math.log10.js","webpack:///../~/core-js/modules/es6.math.log1p.js","webpack:///../~/core-js/modules/es6.math.log2.js","webpack:///../~/core-js/modules/es6.math.sign.js","webpack:///../~/core-js/modules/es6.math.sinh.js","webpack:///../~/core-js/modules/es6.math.tanh.js","webpack:///../~/core-js/modules/es6.math.trunc.js","webpack:///../~/core-js/modules/es6.number.constructor.js","webpack:///../~/core-js/modules/es6.number.epsilon.js","webpack:///../~/core-js/modules/es6.number.is-finite.js","webpack:///../~/core-js/modules/es6.number.is-integer.js","webpack:///../~/core-js/modules/es6.number.is-nan.js","webpack:///../~/core-js/modules/es6.number.is-safe-integer.js","webpack:///../~/core-js/modules/es6.number.max-safe-integer.js","webpack:///../~/core-js/modules/es6.number.min-safe-integer.js","webpack:///../~/core-js/modules/es6.number.parse-float.js","webpack:///../~/core-js/modules/es6.number.parse-int.js","webpack:///../~/core-js/modules/es6.number.to-fixed.js","webpack:///../~/core-js/modules/es6.number.to-precision.js","webpack:///../~/core-js/modules/es6.object.assign.js","webpack:///../~/core-js/modules/es6.object.create.js","webpack:///../~/core-js/modules/es6.object.define-properties.js","webpack:///../~/core-js/modules/es6.object.define-property.js","webpack:///../~/core-js/modules/es6.object.freeze.js","webpack:///../~/core-js/modules/es6.object.get-own-property-descriptor.js","webpack:///../~/core-js/modules/es6.object.get-own-property-names.js","webpack:///../~/core-js/modules/es6.object.get-prototype-of.js","webpack:///../~/core-js/modules/es6.object.is-extensible.js","webpack:///../~/core-js/modules/es6.object.is-frozen.js","webpack:///../~/core-js/modules/es6.object.is-sealed.js","webpack:///../~/core-js/modules/es6.object.is.js","webpack:///../~/core-js/modules/es6.object.keys.js","webpack:///../~/core-js/modules/es6.object.prevent-extensions.js","webpack:///../~/core-js/modules/es6.object.seal.js","webpack:///../~/core-js/modules/es6.object.set-prototype-of.js","webpack:///../~/core-js/modules/es6.object.to-string.js","webpack:///../~/core-js/modules/es6.parse-float.js","webpack:///../~/core-js/modules/es6.parse-int.js","webpack:///../~/core-js/modules/es6.promise.js","webpack:///../~/core-js/modules/es6.reflect.apply.js","webpack:///../~/core-js/modules/es6.reflect.construct.js","webpack:///../~/core-js/modules/es6.reflect.define-property.js","webpack:///../~/core-js/modules/es6.reflect.delete-property.js","webpack:///../~/core-js/modules/es6.reflect.enumerate.js","webpack:///../~/core-js/modules/es6.reflect.get-own-property-descriptor.js","webpack:///../~/core-js/modules/es6.reflect.get-prototype-of.js","webpack:///../~/core-js/modules/es6.reflect.get.js","webpack:///../~/core-js/modules/es6.reflect.has.js","webpack:///../~/core-js/modules/es6.reflect.is-extensible.js","webpack:///../~/core-js/modules/es6.reflect.own-keys.js","webpack:///../~/core-js/modules/es6.reflect.prevent-extensions.js","webpack:///../~/core-js/modules/es6.reflect.set-prototype-of.js","webpack:///../~/core-js/modules/es6.reflect.set.js","webpack:///../~/core-js/modules/es6.regexp.constructor.js","webpack:///../~/core-js/modules/es6.regexp.match.js","webpack:///../~/core-js/modules/es6.regexp.replace.js","webpack:///../~/core-js/modules/es6.regexp.search.js","webpack:///../~/core-js/modules/es6.regexp.split.js","webpack:///../~/core-js/modules/es6.regexp.to-string.js","webpack:///../~/core-js/modules/es6.string.anchor.js","webpack:///../~/core-js/modules/es6.string.big.js","webpack:///../~/core-js/modules/es6.string.blink.js","webpack:///../~/core-js/modules/es6.string.bold.js","webpack:///../~/core-js/modules/es6.string.code-point-at.js","webpack:///../~/core-js/modules/es6.string.ends-with.js","webpack:///../~/core-js/modules/es6.string.fixed.js","webpack:///../~/core-js/modules/es6.string.fontcolor.js","webpack:///../~/core-js/modules/es6.string.fontsize.js","webpack:///../~/core-js/modules/es6.string.from-code-point.js","webpack:///../~/core-js/modules/es6.string.includes.js","webpack:///../~/core-js/modules/es6.string.italics.js","webpack:///../~/core-js/modules/es6.string.iterator.js","webpack:///../~/core-js/modules/es6.string.link.js","webpack:///../~/core-js/modules/es6.string.raw.js","webpack:///../~/core-js/modules/es6.string.repeat.js","webpack:///../~/core-js/modules/es6.string.small.js","webpack:///../~/core-js/modules/es6.string.starts-with.js","webpack:///../~/core-js/modules/es6.string.strike.js","webpack:///../~/core-js/modules/es6.string.sub.js","webpack:///../~/core-js/modules/es6.string.sup.js","webpack:///../~/core-js/modules/es6.string.trim.js","webpack:///../~/core-js/modules/es6.symbol.js","webpack:///../~/core-js/modules/es6.typed.array-buffer.js","webpack:///../~/core-js/modules/es6.typed.data-view.js","webpack:///../~/core-js/modules/es6.typed.float32-array.js","webpack:///../~/core-js/modules/es6.typed.float64-array.js","webpack:///../~/core-js/modules/es6.typed.int16-array.js","webpack:///../~/core-js/modules/es6.typed.int32-array.js","webpack:///../~/core-js/modules/es6.typed.int8-array.js","webpack:///../~/core-js/modules/es6.typed.uint16-array.js","webpack:///../~/core-js/modules/es6.typed.uint32-array.js","webpack:///../~/core-js/modules/es6.typed.uint8-array.js","webpack:///../~/core-js/modules/es6.typed.uint8-clamped-array.js","webpack:///../~/core-js/modules/es6.weak-set.js","webpack:///../~/core-js/modules/es7.array.flat-map.js","webpack:///../~/core-js/modules/es7.array.flatten.js","webpack:///../~/core-js/modules/es7.array.includes.js","webpack:///../~/core-js/modules/es7.asap.js","webpack:///../~/core-js/modules/es7.error.is-error.js","webpack:///../~/core-js/modules/es7.global.js","webpack:///../~/core-js/modules/es7.map.from.js","webpack:///../~/core-js/modules/es7.map.of.js","webpack:///../~/core-js/modules/es7.map.to-json.js","webpack:///../~/core-js/modules/es7.math.clamp.js","webpack:///../~/core-js/modules/es7.math.deg-per-rad.js","webpack:///../~/core-js/modules/es7.math.degrees.js","webpack:///../~/core-js/modules/es7.math.fscale.js","webpack:///../~/core-js/modules/es7.math.iaddh.js","webpack:///../~/core-js/modules/es7.math.imulh.js","webpack:///../~/core-js/modules/es7.math.isubh.js","webpack:///../~/core-js/modules/es7.math.rad-per-deg.js","webpack:///../~/core-js/modules/es7.math.radians.js","webpack:///../~/core-js/modules/es7.math.scale.js","webpack:///../~/core-js/modules/es7.math.signbit.js","webpack:///../~/core-js/modules/es7.math.umulh.js","webpack:///../~/core-js/modules/es7.object.define-getter.js","webpack:///../~/core-js/modules/es7.object.define-setter.js","webpack:///../~/core-js/modules/es7.object.entries.js","webpack:///../~/core-js/modules/es7.object.get-own-property-descriptors.js","webpack:///../~/core-js/modules/es7.object.lookup-getter.js","webpack:///../~/core-js/modules/es7.object.lookup-setter.js","webpack:///../~/core-js/modules/es7.object.values.js","webpack:///../~/core-js/modules/es7.observable.js","webpack:///../~/core-js/modules/es7.promise.finally.js","webpack:///../~/core-js/modules/es7.promise.try.js","webpack:///../~/core-js/modules/es7.reflect.define-metadata.js","webpack:///../~/core-js/modules/es7.reflect.delete-metadata.js","webpack:///../~/core-js/modules/es7.reflect.get-metadata-keys.js","webpack:///../~/core-js/modules/es7.reflect.get-metadata.js","webpack:///../~/core-js/modules/es7.reflect.get-own-metadata-keys.js","webpack:///../~/core-js/modules/es7.reflect.get-own-metadata.js","webpack:///../~/core-js/modules/es7.reflect.has-metadata.js","webpack:///../~/core-js/modules/es7.reflect.has-own-metadata.js","webpack:///../~/core-js/modules/es7.reflect.metadata.js","webpack:///../~/core-js/modules/es7.set.from.js","webpack:///../~/core-js/modules/es7.set.of.js","webpack:///../~/core-js/modules/es7.set.to-json.js","webpack:///../~/core-js/modules/es7.string.at.js","webpack:///../~/core-js/modules/es7.string.match-all.js","webpack:///../~/core-js/modules/es7.string.pad-end.js","webpack:///../~/core-js/modules/es7.string.pad-start.js","webpack:///../~/core-js/modules/es7.string.trim-left.js","webpack:///../~/core-js/modules/es7.string.trim-right.js","webpack:///../~/core-js/modules/es7.symbol.async-iterator.js","webpack:///../~/core-js/modules/es7.symbol.observable.js","webpack:///../~/core-js/modules/es7.system.global.js","webpack:///../~/core-js/modules/es7.weak-map.from.js","webpack:///../~/core-js/modules/es7.weak-map.of.js","webpack:///../~/core-js/modules/es7.weak-set.from.js","webpack:///../~/core-js/modules/es7.weak-set.of.js","webpack:///../~/core-js/modules/web.dom.iterable.js","webpack:///../~/core-js/modules/web.immediate.js","webpack:///../~/core-js/modules/web.timers.js","webpack:///../~/core-js/shim.js","webpack:///../~/regenerator-runtime/runtime.js"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","moduleId","installedModules","i","l","modules","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","global","core","hide","redefine","ctx","$export","type","source","key","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","P","IS_BIND","B","target","expProto","undefined","Function","U","W","R","isObject","it","TypeError","window","Math","self","__g","exec","e","store","uid","Symbol","USE_SYMBOL","toInteger","min","a","anObject","IE8_DOM_DEFINE","toPrimitive","dP","f","O","Attributes","defined","_classCallCheck","instance","Constructor","_createClass","defineProperties","props","length","descriptor","writable","protoProps","staticProps","RRElement","layoutInfo","default","createDesc","has","SRC","$toString","TPL","split","inspectSource","val","safe","isFunction","join","String","fails","quot","createHTML","string","tag","attribute","p1","replace","NAME","test","toLowerCase","pIE","toIObject","gOPD","getOwnPropertyDescriptor","toObject","IE_PROTO","ObjectProto","getPrototypeOf","constructor","IObject","toString","slice","version","__e","aFunction","fn","that","b","apply","arguments","method","arg","ceil","floor","isNaN","RuleDefinitionSign","obj","_grammar","EQUAL","COLON_EQUAL","COLON_COLON_EQUAL","LiteralDefinitionSign","QUOTE","DOUBLE_QUOTE","GrammarToBNF","ruleDefinitionSign","literalDefinitionSign","isCommaSeparator","isUsingMultiplicationTokens","ruleConsideredAsLineBreak","grammar","toBNF","_interopRequireDefault","_rule","GrammarToRRDiagram","_rrdiagram","ruleLinkProvider","ruleName","rule","toRRDiagram","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","res","index","result","push","KEY","valueOf","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","set","keyMetadata","ordinaryHasOwnMetadata","MetadataKey","metadataMap","ordinaryGetOwnMetadata","ordinaryDefineOwnMetadata","MetadataValue","ordinaryOwnMetadataKeys","keys","forEach","_","toMetaKey","map","LIBRARY","$typed","$buffer","anInstance","propertyDesc","redefineAll","toIndex","toAbsoluteIndex","classof","isArrayIter","gOPN","getIterFn","wks","createArrayMethod","createArrayIncludes","speciesConstructor","ArrayIterators","Iterators","$iterDetect","setSpecies","arrayFill","arrayCopyWithin","$DP","$GOPD","RangeError","Uint8Array","ArrayProto","Array","$ArrayBuffer","ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayIndexOf","arrayValues","values","arrayKeys","arrayEntries","entries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","ITERATOR","TAG","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","$map","allocate","LITTLE_ENDIAN","Uint16Array","buffer","FORCED_SET","toOffset","BYTES","offset","validate","C","speciesFromList","list","fromList","addGetter","internal","_d","$from","step","iterator","aLen","mapfn","mapping","iterFn","next","done","$of","TO_LOCALE_BUG","$toLocaleString","proto","copyWithin","start","every","fill","filter","find","predicate","findIndex","indexOf","searchElement","includes","separator","reverse","middle","some","comparefn","subarray","begin","end","$begin","byteOffset","BYTES_PER_ELEMENT","$slice","$set","arrayLike","src","len","$iterators","isTAIndex","$getDesc","$setDesc","desc","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","Base","TAC","FORCED","ABV","TypedArrayPrototype","data","v","setter","round","addElement","$offset","$length","byteLength","klass","$len","iter","concat","$nativeIterator","CORRECT_ITER_NAME","$iterator","of","from","_grammartorrdiagram","_grammartobnf","_rrelement2","_rrelement","Expression","grammarToRRDiagram","grammarToBNF","sb","isNested","UNSCOPABLES","META","setDesc","id","isExtensible","FREEZE","preventExtensions","setMeta","w","fastKey","getWeak","onFreeze","meta","NEED","forbiddenField","BREAK","RETURN","iterable","dPs","enumBugKeys","Empty","createDict","iframeDocument","iframe","style","display","appendChild","contentWindow","document","open","write","lt","close","Properties","$keys","hiddenKeys","getOwnPropertyNames","bitmap","DESCRIPTORS","SPECIES","max","px","random","_t","cof","ARG","tryGet","T","callee","def","stat","spaces","space","non","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","trim","LayoutInfo","width","height","connectorOffset","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_rrdiagramtosvg2","_rrdiagramtosvg","_layoutinfo2","_layoutinfo","Type","LITERAL","RULE","SPECIAL_SEQUENCE","RRText","text","link","fontInfo","_RRElement","rrDiagramToSVG","insets","top","left","bottom","right","cssTextClass","cssRuleTextClass","cssLiteralTextClass","cssSpecialSequenceTextClass","getFontInfo","textWidth","fontYOffset","descent","setLayoutInfo","xOffset","yOffset","svgContent","getLayoutInfo","getWidth","getHeight","escapeXml","cssClass","shape","cssRuleClass","ruleShape","cssLiteralClass","literalShape","cssSpecialSequenceClass","specialSequenceShape","RRDiagramToSVG","BoxShape","RECTANGLE","ROUNDED_RECTANGLE","rx","HEXAGON","getConnectorOffset","addLineConnector","textHeight","textXOffset","textYOffset","ignoreCase","multiline","unicode","sticky","propertyIsEnumerable","mode","copyright","D","_rrdiagram2","_grammartobnf2","_expression","Rule","expression","originalExpressionText","RRDiagram","toRRElement","_rrsequence2","_rrsequence","_svgcontent2","_svgcontent","_rrbreak2","_rrbreak","rrElement","rrElementList","RRSequence","cursorElementList","getRRElements","element","RRBreak","rrElement_","computeLayoutInfo","SvgContent","layoutInfo2","connectorOffset2","width2","height2","y1","toSVG","connectorElement","getConnectorElement","elements","getElements","_rrtext","cssConnectorClass","cssLoopCardinalitiesTextClass","rrDiagram","IS_INCLUDES","el","fromIndex","forOf","setToStringTag","inheritIfRequired","methods","common","IS_WEAK","ADDER","fixMethod","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","clear","getConstructor","setStrong","regexpExec","REPLACE_SUPPORTS_NAMED_GROUPS","re","groups","SPLIT_WORKS_WITH_OVERWRITTEN_EXEC","originalExec","SYMBOL","DELEGATES_TO_SYMBOL","DELEGATES_TO_EXEC","execCalled","nativeRegExpMethod","fns","nativeMethod","regexp","str","arg2","forceStringMethod","strfn","rxfn","isArray","MATCH","isRegExp","SAFE_CLOSING","riter","skipClosing","arr","K","__defineSetter__","getOwnPropertySymbols","builtinExec","COLLECTION","A","cb","mapFn","nextItem","TO_STRING","pos","charCodeAt","charAt","Typed","TypedArrayConstructors","navigator","userAgent","Grammar","rules","_expression2","_rrtext2","Literal","_Expression","_rrchoice2","_rrchoice","_rrline2","_rrline","_rrloop2","_rrloop","Repetition","minRepetitionCount","maxRepetitionCount","RRChoice","RRLoop","RRLine","equals","RuleReference","_rulereference2","_rulereference","_repetition2","_repetition","_literal2","_literal","Sequence","expressions","repetition","repetitionExpression","getExpression","subExpressions","getExpressions","getMaxRepetitionCount","getMinRepetitionCount","ruleLink","getRuleName","rrElements","x1","x2","xOffset2","y2","yOffset2","addPathConnector","loopElement","IllegalArgumentException","cardinalitiesText","cardinalitiesWidth","layoutInfo1","width1","maxWidth","loopOffset","loopWidth","loopPathStartX","aboveConnector","belowConnector","widthOffset","unsafe","fontCssClass","container","body","testDiv","createElement","className","computedStyle","getComputedStyle","fontSize","getPropertyValue","fontFamily","removeChild","parent","image","textNode","createTextNode","offsetHeight","offsetWidth","forceWidth","cssText","offsetTop","at","endPos","original","$defineProperty","is","documentElement","IteratorPrototype","$iterCreate","BUGGY","returnThis","DEFAULT","IS_SET","getMethod","kind","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","$expm1","expm1","x","sign","macrotask","Observer","MutationObserver","WebKitMutationObserver","process","Promise","isNode","head","last","notify","flush","domain","exit","enter","nextTick","standalone","resolve","promise","then","toggle","node","observe","characterData","task","PromiseCapability","reject","$$resolve","$$reject","regexpFlags","nativeExec","nativeReplace","patchedExec","UPDATES_LAST_INDEX_WRONG","re1","re2","NPCG_INCLUDED","lastIndex","reCopy","match","check","buggy","searchString","count","Infinity","defer","channel","port","invoke","html","cel","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","run","listener","event","args","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","setTimeout","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","pow","abs","log","LN2","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","PROTOTYPE","view","isLittleEndian","numIndex","intIndex","$LENGTH","WRONG_INDEX","$BUFFER","_b","$OFFSET","pack","conversion","BaseBuffer","ArrayBufferProto","j","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","wksExt","$Symbol","getIteratorMethod","addToUnscopables","iterated","_i","_k","Arguments","createRule","chunk","prune","loadExpression","parentChunk","readNext","stopChar","expressionTextSB","lastChar","isFirst","isInSpecialGroup","specialGroupChar","isLiteral","getType","Chunk","ChunkType","setText","GROUP","setType","COMMENT","comment","content","addChunk","ALTERNATION","REPETITION_TOKEN","literalChunk","subExpressionText","groupChunk","optionChunk","OPTION","repetitionChunk","REPETITION","setMinCount","_chunk2","_chunk","_rule2","_grammar2","BNFToGrammar","char","ruleList","expressionText","endsWith","c2","_sequence2","_sequence","Choice","expressionList","hasNoop","SpecialSequence","msg","to","inc","memo","isRight","factories","construct","bind","partArgs","bound","$iterDefine","SIZE","getEntry","entry","_f","k","_l","r","prev","$has","uncaughtFrozenStore","UncaughtFrozenStore","findUncaughtFrozen","splice","ufstore","flattenIntoArray","sourceLen","depth","mapper","thisArg","spreadable","targetIndex","sourceIndex","IS_CONCAT_SPREADABLE","un","isFinite","ret","EPSILON","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","log1p","scale","inLow","inHigh","outLow","outHigh","getKeys","gOPS","$assign","assign","getSymbols","isEnum","windowNames","getWindowNames","names","isEntries","Reflect","ownKeys","$parseFloat","parseFloat","$trim","$parseInt","parseInt","ws","hex","radix","newPromiseCapability","promiseCapability","y","repeat","maxLength","fillString","stringLength","fillStr","intMaxLength","fillLen","stringFiller","number","strong","forced","flags","add","InternalMap","each","weak","NATIVE_WEAK_MAP","IS_IE11","ActiveXObject","$WeakMap","g","eval","ui","model","bnfdisplay","_BNFDisplay2","_BNFDisplay","_bnftogrammar2","_bnftogrammar","_choice2","_choice","_grammartorrdiagram2","_specialsequence2","_specialsequence","BNFDisplay","DEFINE_PROPERTY","_babelPolyfill","Error","padStart","padEnd","bnfToGrammar","newClassName","getElementsByClassName","tagName","newElement","bnf","innerHTML","convert","getRules","svg","svgContainer","parentElement","replaceChild","isNoop","CHOICE","minCount","maxCount","chunkList","hasAlternation","previousChunk","multiplier","nextChunk","newChunk","setMaxCount","alternationSequenceList","choiceChunk","subList","hasLine","subChunk","cChunk","_svgline2","_svgline","_svgpath2","_svgpath","connectorList","path","SvgPath","addPath","svgLine","x1_","getX1","y1_","getY1","x2_","getX2","y2_","getY2","mergeLine","SvgLine","path0","connector","addLine","getPath","svgline","startX","startY","endX","endY","pathSB","svgPath","escape","getTime","Date","$toISOString","toISOString","lz","num","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","hint","symbols","regExp","replacer","part","$re","$every","$filter","$find","$forEach","STRICT","createProperty","$indexOf","NEGATIVE_ZERO","$reduce","upTo","size","cloned","$some","$sort","toJSON","pv","TO_PRIMITIVE","DateProto","HAS_INSTANCE","FunctionProto","FProto","nameRE","sqrt","$acosh","acosh","Number","MAX_VALUE","asinh","$asinh","$atanh","atanh","cbrt","clz32","LOG2E","cosh","hypot","value1","value2","div","sum","larg","$imul","imul","xn","yn","xl","yl","log10","LOG10E","log2","sinh","E","tanh","trunc","$Number","BROKEN_COF","TRIM","toNumber","argument","third","maxCode","first","code","digits","_isFinite","isInteger","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","aNumberValue","$toFixed","toFixed","ERROR","multiply","divide","numToString","t","acc","fractionDigits","z","$fails","$toPrecision","toPrecision","precision","$freeze","$getOwnPropertyDescriptor","$getPrototypeOf","$isExtensible","$isFrozen","$isSealed","$preventExtensions","$seal","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","versions","v8","$Promise","empty","USE_NATIVE","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_c","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","capability","all","remaining","$index","alreadyCalled","race","rApply","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","Enumerate","enumerate","getProto","receiver","setProto","V","existingDescriptor","ownDesc","$flags","$RegExp","CORRECT_NEW","tiRE","piRE","fiU","advanceStringIndex","regExpExec","$match","maybeCallNative","fullUnicode","matchStr","SUBSTITUTION_SYMBOLS","SUBSTITUTION_SYMBOLS_NO_NAMED","maybeToString","REPLACE","$replace","getSubstitution","matched","position","captures","namedCaptures","replacement","tailPos","ch","capture","searchValue","replaceValue","functionalReplace","results","accumulatedResult","nextSourcePosition","replacerArgs","sameValue","SEARCH","$search","previousLastIndex","callRegExpExec","$min","$push","LENGTH","SUPPORTS_Y","SPLIT","$split","internalSplit","limit","lastLength","output","lastLastIndex","splitLimit","separatorCopy","splitter","unicodeMatching","lim","q","$at","codePointAt","context","$endsWith","endPosition","search","color","fromCharCode","$fromCodePoint","fromCodePoint","point","url","raw","callSite","tpl","$startsWith","startsWith","wksDefine","enumKeys","_create","gOPNExt","$GOPS","$JSON","JSON","_stringify","stringify","HIDDEN","SymbolRegistry","AllSymbols","OPSymbols","QObject","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","keyFor","useSetter","useSimple","FAILS_ON_PRIMITIVES","$replacer","$isView","isView","fin","viewS","viewT","init","arraySpeciesCreate","flatMap","flatten","depthArg","$includes","asap","isError","clamp","lower","upper","DEG_PER_RAD","PI","RAD_PER_DEG","degrees","radians","fscale","iaddh","x0","y0","$x0","$x1","$y0","imulh","u","$u","$v","u0","v0","u1","v1","isubh","signbit","umulh","__defineGetter__","getOwnPropertyDescriptors","getDesc","__lookupGetter__","__lookupSetter__","$values","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","subscribe","observable","items","Observable","onFinally","metadata","defineMetadata","metadataKey","metadataValue","deleteMetadata","Set","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","ordinaryGetMetadata","getMetadata","getOwnMetadataKeys","getOwnMetadata","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","$metadata","getFlags","RegExpProto","$RegExpStringIterator","_r","matchAll","$pad","WEBKIT_BUG","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","$task","MSIE","time","boundArgs","setInterval","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","Context","_invoke","makeInvokeMethod","tryCatch","GeneratorFunction","GeneratorFunctionPrototype","defineIteratorMethods","AsyncIterator","record","hasOwn","__await","unwrapped","enqueue","callInvokeWithMethodAndArg","previousPromise","state","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","GenStateSuspendedYield","return","info","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iteratorMethod","iteratorSymbol","Op","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","inModule","runtime","regeneratorRuntime","NativeIteratorPrototype","Gp","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","pop","skipTempReset","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","finish","thrown","delegateYield"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,OAAO,eAAiBH,GACE,gBAAZC,SACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,KACnBK,KAAM,WACT,M,aCNE,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUN,OAGnC,IAAIC,GAASM,EAAiBD,IAC7BE,EAAGF,EACHG,GAAG,EACHT,WAUD,OANAU,GAAQJ,GAAUK,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASK,GAG/DJ,EAAOQ,GAAI,EAGJR,EAAOD,QAvBf,GAAIO,KA+DJ,OAnCAF,GAAoBO,EAAIF,EAGxBL,EAAoBQ,EAAIN,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EAAOz7C,KAAkB,CAC3B,GAAI6/C,GAASpE,EAAOh1C,GACpBg3C,GAAcpnB,GAEhB,MAAOwpB,IAMX,KAAM,IAAItjB,OAAM,0BAGlBujB,cAAe,SAAS3pC,EAAU6mC,EAAYC,GAa5C,MAZAn/C,MAAKu+C,UACHnsC,SAAU7C,EAAO8I,GACjB6mC,WAAYA,EACZC,QAASA,GAGS,SAAhBn/C,KAAK0I,SAGP1I,KAAK2I,IAAMvF,GAGNs7C,KAOO,gBAAX98C,GAAsBA,EACX,gBAAXgC,QAAsBA,OACb,gBAATE,MAAoBA,KAAO9D,QzWw1YPO,KAAKX,EAASK,EAAoB,OAIzD,SAAUJ,EAAQD,EAASK,GAEjCA,EAAoB,KACpBJ,EAAOD,QAAUK,EAAoB","file":"rrdiagram.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"rrdiagram\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rrdiagram\"] = factory();\n\telse\n\t\troot[\"rrdiagram\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 361);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 584aa1e0b3855d207932","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"rrdiagram\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rrdiagram\"] = factory();\n\telse\n\t\troot[\"rrdiagram\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 361);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar core = __webpack_require__(20);\nvar hide = __webpack_require__(12);\nvar redefine = __webpack_require__(13);\nvar ctx = __webpack_require__(21);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar store = __webpack_require__(56)('wks');\nvar uid = __webpack_require__(45);\nvar Symbol = __webpack_require__(2).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.15 ToLength\nvar toInteger = __webpack_require__(23);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(3)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(1);\nvar IE8_DOM_DEFINE = __webpack_require__(125);\nvar toPrimitive = __webpack_require__(29);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(27);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RRElement = function () {\n function RRElement() {\n _classCallCheck(this, RRElement);\n\n this.layoutInfo = null;\n }\n\n _createClass(RRElement, [{\n key: \"setLayoutInfo\",\n value: function setLayoutInfo(layoutInfo) {\n this.layoutInfo = layoutInfo;\n }\n }, {\n key: \"getLayoutInfo\",\n value: function getLayoutInfo() {\n return this.layoutInfo;\n }\n }]);\n\n return RRElement;\n}();\n\nexports.default = RRElement;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(8);\nvar createDesc = __webpack_require__(41);\nmodule.exports = __webpack_require__(7) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar hide = __webpack_require__(12);\nvar has = __webpack_require__(15);\nvar SRC = __webpack_require__(45)('src');\nvar $toString = __webpack_require__(165);\nvar TO_STRING = 'toString';\nvar TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(20).inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar fails = __webpack_require__(3);\nvar defined = __webpack_require__(27);\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '&quot;') + '\"';\n return p1 + '>' + S + '</' + tag + '>';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pIE = __webpack_require__(55);\nvar createDesc = __webpack_require__(41);\nvar toIObject = __webpack_require__(18);\nvar toPrimitive = __webpack_require__(29);\nvar has = __webpack_require__(15);\nvar IE8_DOM_DEFINE = __webpack_require__(125);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(15);\nvar toObject = __webpack_require__(9);\nvar IE_PROTO = __webpack_require__(103)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(54);\nvar defined = __webpack_require__(27);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\nvar core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// optional / simple context binding\nvar aFunction = __webpack_require__(10);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar fails = __webpack_require__(3);\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _grammar = __webpack_require__(75);\n\nvar _grammar2 = _interopRequireDefault(_grammar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RuleDefinitionSign = {\n EQUAL: 1,\n COLON_EQUAL: 2,\n COLON_COLON_EQUAL: 3\n};\n\nvar LiteralDefinitionSign = {\n QUOTE: 1,\n DOUBLE_QUOTE: 2\n};\n\nvar GrammarToBNF = function () {\n _createClass(GrammarToBNF, null, [{\n key: 'RuleDefinitionSign',\n get: function get() {\n return RuleDefinitionSign;\n }\n }, {\n key: 'LiteralDefinitionSign',\n get: function get() {\n return LiteralDefinitionSign;\n }\n }]);\n\n function GrammarToBNF() {\n _classCallCheck(this, GrammarToBNF);\n\n this.ruleDefinitionSign = RuleDefinitionSign.EQUAL;\n this.literalDefinitionSign = LiteralDefinitionSign.QUOTE;\n this.isCommaSeparator = false;\n this.isUsingMultiplicationTokens = false;\n this.ruleConsideredAsLineBreak = null;\n }\n\n /**\r\n * @param {Grammar} grammar \r\n * @return {string}\r\n */\n\n\n _createClass(GrammarToBNF, [{\n key: 'convert',\n value: function convert(grammar) {\n return grammar.toBNF(this);\n }\n }]);\n\n return GrammarToBNF;\n}();\n\nexports.default = GrammarToBNF;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rule = __webpack_require__(58);\n\nvar _rule2 = _interopRequireDefault(_rule);\n\nvar _rrdiagram = __webpack_require__(59);\n\nvar _rrdiagram2 = _interopRequireDefault(_rrdiagram);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar GrammarToRRDiagram = function () {\n function GrammarToRRDiagram() {\n _classCallCheck(this, GrammarToRRDiagram);\n\n this.ruleLinkProvider = function (ruleName) {\n return '#' + ruleName;\n };\n this.ruleConsideredAsLineBreak = null;\n }\n\n /**\r\n * @param {Rule} rule \r\n * @return {RRDiagram}\r\n */\n\n\n _createClass(GrammarToRRDiagram, [{\n key: 'convert',\n value: function convert(rule) {\n return rule.toRRDiagram(this);\n }\n }]);\n\n return GrammarToRRDiagram;\n}();\n\nexports.default = GrammarToRRDiagram;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(21);\nvar IObject = __webpack_require__(54);\nvar toObject = __webpack_require__(9);\nvar toLength = __webpack_require__(6);\nvar asc = __webpack_require__(87);\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports) {\n\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(20);\nvar fails = __webpack_require__(3);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(4);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Map = __webpack_require__(147);\nvar $export = __webpack_require__(0);\nvar shared = __webpack_require__(56)('metadata');\nvar store = shared.store || (shared.store = new (__webpack_require__(151))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nif (__webpack_require__(7)) {\n var LIBRARY = __webpack_require__(34);\n var global = __webpack_require__(2);\n var fails = __webpack_require__(3);\n var $export = __webpack_require__(0);\n var $typed = __webpack_require__(73);\n var $buffer = __webpack_require__(108);\n var ctx = __webpack_require__(21);\n var anInstance = __webpack_require__(36);\n var propertyDesc = __webpack_require__(41);\n var hide = __webpack_require__(12);\n var redefineAll = __webpack_require__(42);\n var toInteger = __webpack_require__(23);\n var toLength = __webpack_require__(6);\n var toIndex = __webpack_require__(145);\n var toAbsoluteIndex = __webpack_require__(44);\n var toPrimitive = __webpack_require__(29);\n var has = __webpack_require__(15);\n var classof = __webpack_require__(47);\n var isObject = __webpack_require__(4);\n var toObject = __webpack_require__(9);\n var isArrayIter = __webpack_require__(94);\n var create = __webpack_require__(38);\n var getPrototypeOf = __webpack_require__(17);\n var gOPN = __webpack_require__(39).f;\n var getIterFn = __webpack_require__(110);\n var uid = __webpack_require__(45);\n var wks = __webpack_require__(5);\n var createArrayMethod = __webpack_require__(26);\n var createArrayIncludes = __webpack_require__(61);\n var speciesConstructor = __webpack_require__(57);\n var ArrayIterators = __webpack_require__(111);\n var Iterators = __webpack_require__(48);\n var $iterDetect = __webpack_require__(66);\n var setSpecies = __webpack_require__(43);\n var arrayFill = __webpack_require__(86);\n var arrayCopyWithin = __webpack_require__(117);\n var $DP = __webpack_require__(8);\n var $GOPD = __webpack_require__(16);\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Expression = function () {\n function Expression() {\n _classCallCheck(this, Expression);\n }\n\n _createClass(Expression, [{\n key: 'toRRElement',\n\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n value: function toRRElement(grammarToRRDiagram) {\n // Not reachable, we don't instanciate this class.\n return new _rrelement2.default();\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {}\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {}\n }]);\n\n return Expression;\n}();\n\nexports.default = Expression;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(5)('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(12)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\nmodule.exports = false;\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar META = __webpack_require__(45)('meta');\nvar isObject = __webpack_require__(4);\nvar has = __webpack_require__(15);\nvar setDesc = __webpack_require__(8).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(3)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(21);\nvar call = __webpack_require__(128);\nvar isArrayIter = __webpack_require__(94);\nvar anObject = __webpack_require__(1);\nvar toLength = __webpack_require__(6);\nvar getIterFn = __webpack_require__(110);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(1);\nvar dPs = __webpack_require__(134);\nvar enumBugKeys = __webpack_require__(90);\nvar IE_PROTO = __webpack_require__(103)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(89)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(92).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(136);\nvar hiddenKeys = __webpack_require__(90).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(136);\nvar enumBugKeys = __webpack_require__(90);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar redefine = __webpack_require__(13);\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(2);\nvar dP = __webpack_require__(8);\nvar DESCRIPTORS = __webpack_require__(7);\nvar SPECIES = __webpack_require__(5)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(23);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nvar id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(19);\nvar TAG = __webpack_require__(5)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\nmodule.exports = {};\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar def = __webpack_require__(8).f;\nvar has = __webpack_require__(15);\nvar TAG = __webpack_require__(5)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar defined = __webpack_require__(27);\nvar fails = __webpack_require__(3);\nvar spaces = __webpack_require__(106);\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LayoutInfo = function () {\n\n /**\r\n * @param {number} width \r\n * @param {number} height \r\n * @param {number} connectorOffset \r\n */\n function LayoutInfo(width, height, connectorOffset) {\n _classCallCheck(this, LayoutInfo);\n\n this.width = width;\n this.height = height;\n this.connectorOffset = connectorOffset;\n }\n\n /**\r\n * @return {number}\r\n */\n\n\n _createClass(LayoutInfo, [{\n key: \"getWidth\",\n value: function getWidth() {\n return this.width;\n }\n\n /**\r\n * @return {number}\r\n */\n\n }, {\n key: \"getHeight\",\n value: function getHeight() {\n return this.height;\n }\n\n /**\r\n * @return {number}\r\n */\n\n }, {\n key: \"getConnectorOffset\",\n value: function getConnectorOffset() {\n return this.connectorOffset;\n }\n }]);\n\n return LayoutInfo;\n}();\n\nexports.default = LayoutInfo;\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _rrdiagramtosvg = __webpack_require__(60);\n\nvar _rrdiagramtosvg2 = _interopRequireDefault(_rrdiagramtosvg);\n\nvar _layoutinfo = __webpack_require__(51);\n\nvar _layoutinfo2 = _interopRequireDefault(_layoutinfo);\n\nvar _utils = __webpack_require__(84);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 Type = {\n LITERAL: 1,\n RULE: 2,\n SPECIAL_SEQUENCE: 3\n};\n\nvar RRText = function (_RRElement) {\n _inherits(RRText, _RRElement);\n\n _createClass(RRText, null, [{\n key: 'Type',\n get: function get() {\n return Type;\n }\n\n /**\r\n * \r\n * @param {Type} type \r\n * @param {string} text \r\n * @param {?string} link \r\n */\n\n }]);\n\n function RRText(type, text, link) {\n _classCallCheck(this, RRText);\n\n var _this = _possibleConstructorReturn(this, (RRText.__proto__ || Object.getPrototypeOf(RRText)).call(this));\n\n _this.type = type;\n _this.text = text;\n _this.link = link;\n _this.fontInfo = null;\n return _this;\n }\n\n _createClass(RRText, [{\n key: 'getType',\n value: function getType() {\n return this.type;\n }\n }, {\n key: 'getText',\n value: function getText() {\n return this.text;\n }\n }, {\n key: 'getLink',\n value: function getLink() {\n return this.link;\n }\n }, {\n key: 'computeLayoutInfo',\n value: function computeLayoutInfo(rrDiagramToSVG) {\n var insets = {\n top: 5,\n left: 10,\n bottom: 5,\n right: 10\n };\n var cssTextClass = void 0;\n if (this.type == Type.RULE) {\n cssTextClass = rrDiagramToSVG.cssRuleTextClass;\n } else if (this.type == Type.LITERAL) {\n cssTextClass = rrDiagramToSVG.cssLiteralTextClass;\n } else if (this.type == Type.SPECIAL_SEQUENCE) {\n cssTextClass = rrDiagramToSVG.cssSpecialSequenceTextClass;\n } else {\n throw 'Unknown type: type';\n }\n this.fontInfo = (0, _utils.getFontInfo)(this.text, cssTextClass);\n var width = this.fontInfo.textWidth;\n var height = this.fontInfo.height;\n var fontYOffset = this.fontInfo.descent;\n var connectorOffset = insets.top + height - fontYOffset;\n width += insets.left + insets.right;\n height += insets.top + insets.bottom;\n this.setLayoutInfo(new _layoutinfo2.default(width, height, connectorOffset));\n }\n }, {\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\n var insets = {\n top: 5,\n left: 10,\n bottom: 5,\n right: 10\n };\n var layoutInfo = this.getLayoutInfo();\n var width = layoutInfo.getWidth();\n var height = layoutInfo.getHeight();\n if (this.link != null) {\n svgContent.addElement(\"<a xlink:href=\\\"\" + (0, _utils.escapeXml)(this.link) /* + \"\\\" xlink:title=\\\"\" + escapeXml(this.text)*/ + \"\\\">\");\n }\n var cssClass = void 0;\n var cssTextClass = void 0;\n var shape = void 0;\n if (this.type == Type.RULE) {\n cssClass = rrDiagramToSVG.cssRuleClass;\n cssTextClass = rrDiagramToSVG.cssRuleTextClass;\n shape = rrDiagramToSVG.ruleShape;\n } else if (this.type == Type.LITERAL) {\n cssClass = rrDiagramToSVG.cssLiteralClass;\n cssTextClass = rrDiagramToSVG.cssLiteralTextClass;\n shape = rrDiagramToSVG.literalShape;\n } else if (this.type == Type.SPECIAL_SEQUENCE) {\n cssClass = rrDiagramToSVG.cssSpecialSequenceClass;\n cssTextClass = rrDiagramToSVG.cssSpecialSequenceTextClass;\n shape = rrDiagramToSVG.specialSequenceShape;\n } else {\n throw 'Unknown type: type';\n }\n if (shape == _rrdiagramtosvg2.default.BoxShape.RECTANGLE) {\n svgContent.addElement(\"<rect class=\\\"\" + cssClass + \"\\\" x=\\\"\" + xOffset + \"\\\" y=\\\"\" + yOffset + \"\\\" width=\\\"\" + width + \"\\\" height=\\\"\" + height + \"\\\"/>\");\n } else if (shape == _rrdiagramtosvg2.default.BoxShape.ROUNDED_RECTANGLE) {\n var rx = Math.floor((insets.left + insets.right + insets.top + insets.bottom) / 4);\n svgContent.addElement(\"<rect class=\\\"\" + cssClass + \"\\\" x=\\\"\" + xOffset + \"\\\" y=\\\"\" + yOffset + \"\\\" width=\\\"\" + width + \"\\\" height=\\\"\" + height + \"\\\" rx=\\\"\" + rx + \"\\\"/>\");\n } else if (shape == _rrdiagramtosvg2.default.BoxShape.HEXAGON) {\n // We don't calculate the exact length of the connector: it goes behind the shape.\n // We should calculate if we want to support transparent shapes.\n var connectorOffset = layoutInfo.getConnectorOffset();\n svgContent.addLineConnector(xOffset, yOffset + connectorOffset, xOffset + insets.left, yOffset + connectorOffset);\n svgContent.addElement(\"<polygon class=\\\"\" + (0, _utils.escapeXml)(cssClass) + \"\\\" points=\\\"\" + xOffset + \" \" + (yOffset + Math.floor(height / 2)) + \" \" + (xOffset + insets.left) + \" \" + yOffset + \" \" + (xOffset + width - insets.right) + \" \" + yOffset + \" \" + (xOffset + width) + \" \" + (yOffset + Math.floor(height / 2)) + \" \" + (xOffset + width - insets.right) + \" \" + (yOffset + height) + \" \" + (xOffset + insets.left) + \" \" + (yOffset + height) + \"\\\"/>\");\n svgContent.addLineConnector(xOffset + width, yOffset + connectorOffset, xOffset + width - insets.right, yOffset + connectorOffset);\n }\n var fontYOffset = this.fontInfo.descent;\n var textHeight = this.fontInfo.textHeight;\n var textXOffset = xOffset + insets.left;\n var textYOffset = yOffset + insets.top + textHeight - fontYOffset;\n svgContent.addElement(\"<text class=\\\"\" + (0, _utils.escapeXml)(cssTextClass) + \"\\\" x=\\\"\" + textXOffset + \"\\\" y=\\\"\" + textYOffset + \"\\\">\" + (0, _utils.escapeXml)(this.text) + \"</text>\");\n if (this.link != null) {\n svgContent.addElement(\"</a>\");\n }\n }\n }]);\n\n return RRText;\n}(_rrelement2.default);\n\nexports.default = RRText;\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(1);\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(19);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports) {\n\nexports.f = {}.propertyIsEnumerable;\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar core = __webpack_require__(20);\nvar global = __webpack_require__(2);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(34) ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(1);\nvar aFunction = __webpack_require__(10);\nvar SPECIES = __webpack_require__(5)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrdiagram = __webpack_require__(59);\n\nvar _rrdiagram2 = _interopRequireDefault(_rrdiagram);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Rule = function () {\n\n /**\r\n * @param {string} name \r\n * @param {Expression} expression \r\n * @param {?string} originalExpressionText \r\n */\n function Rule(name, expression, originalExpressionText) {\n _classCallCheck(this, Rule);\n\n this.name = name;\n this.expression = expression;\n this.originalExpressionText = originalExpressionText;\n }\n\n /**\r\n * @return {string}\r\n */\n\n\n _createClass(Rule, [{\n key: 'getName',\n value: function getName() {\n return this.name;\n }\n\n /**\r\n * @return {?string}\r\n */\n\n }, {\n key: 'getOriginalExpressionText',\n value: function getOriginalExpressionText() {\n return this.originalExpressionText;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRDiagram}\r\n */\n\n }, {\n key: 'toRRDiagram',\n value: function toRRDiagram(grammarToRRDiagram) {\n return new _rrdiagram2.default(this.expression.toRRElement(grammarToRRDiagram));\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @return {string}\r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF) {\n var sb = [];\n sb.push(this.name, \" \");\n switch (grammarToBNF.ruleDefinitionSign) {\n case _grammartobnf2.default.RuleDefinitionSign.EQUAL:\n sb.push(\"=\");break;\n case _grammartobnf2.default.RuleDefinitionSign.COLON_EQUAL:\n sb.push(\":=\");break;\n case _grammartobnf2.default.RuleDefinitionSign.COLON_COLON_EQUAL:\n sb.push(\"::=\");break;\n }\n sb.push(\" \");\n this.expression.toBNF(grammarToBNF, sb, false);\n sb.push(\";\");\n return sb.join(\"\");\n }\n }]);\n\n return Rule;\n}();\n\nexports.default = Rule;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _rrsequence = __webpack_require__(83);\n\nvar _rrsequence2 = _interopRequireDefault(_rrsequence);\n\nvar _svgcontent = __webpack_require__(157);\n\nvar _svgcontent2 = _interopRequireDefault(_svgcontent);\n\nvar _rrbreak = __webpack_require__(80);\n\nvar _rrbreak2 = _interopRequireDefault(_rrbreak);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RRDiagram = function () {\n\n /**\r\n * @param {RRElement} rrElement \r\n */\n function RRDiagram(rrElement) {\n _classCallCheck(this, RRDiagram);\n\n this.rrElement = rrElement;\n }\n\n _createClass(RRDiagram, [{\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG) {\n var rrElementList = [];\n if (this.rrElement instanceof _rrsequence2.default) {\n var cursorElementList = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.rrElement.getRRElements()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var element = _step.value;\n\n if (element instanceof _rrbreak2.default) {\n if (cursorElementList.length != 0) {\n rrElementList.push(cursorElementList.length == 1 ? cursorElementList[0] : new _rrsequence2.default(cursorElementList.slice()));\n cursorElementList.length = 0;\n }\n } else {\n cursorElementList.push(element);\n }\n }\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 if (cursorElementList.length != 0) {\n rrElementList.push(cursorElementList.length == 1 ? cursorElementList[0] : new _rrsequence2.default(cursorElementList.slice()));\n }\n } else {\n rrElementList.push(this.rrElement);\n }\n var width = 5;\n var height = 5;\n for (var i = 0; i < rrElementList.length; i++) {\n if (i > 0) {\n height += 5;\n }\n var rrElement_ = rrElementList[i];\n rrElement_.computeLayoutInfo(rrDiagramToSVG);\n var layoutInfo = rrElement_.getLayoutInfo();\n width = Math.max(width, 5 + layoutInfo.getWidth() + 5);\n height += layoutInfo.getHeight() + 5;\n }\n var svgContent = new _svgcontent2.default();\n // First, generate the XML for the elements, to know the usage.\n var xOffset = 0;\n var yOffset = 5;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = rrElementList[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _rrElement_ = _step2.value;\n\n var layoutInfo2 = _rrElement_.getLayoutInfo();\n var connectorOffset2 = layoutInfo2.getConnectorOffset();\n var width2 = layoutInfo2.getWidth();\n var height2 = layoutInfo2.getHeight();\n var y1 = yOffset + connectorOffset2;\n svgContent.addLineConnector(xOffset, y1, xOffset + 5, y1);\n // TODO: add decorations (like arrows)?\n _rrElement_.toSVG(rrDiagramToSVG, xOffset + 5, yOffset, svgContent);\n svgContent.addLineConnector(xOffset + 5 + width2, y1, xOffset + 5 + width2 + 5, y1);\n yOffset += height2 + 10;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var connectorElement = svgContent.getConnectorElement(rrDiagramToSVG);\n var elements = svgContent.getElements();\n // Then generate the rest (CSS and SVG container tags) based on that usage.\n var sb = [];\n sb.push(\"<svg version=\\\"1.1\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"\", width, \"\\\" height=\\\"\", height, \"\\\" viewbox=\\\"0 0 \" + width + \" \" + height + \"\\\">\");\n /* String styles = svgContent.getCSSStyles();\r\n if(styles.length() > 0) {\r\n sb.push(\"<defs><style type=\\\"text/css\\\">\");\r\n sb.push(styles);\r\n sb.push(\"</style></defs>\");\r\n }*/\n sb.push(connectorElement);\n sb.push(elements);\n sb.push(\"</svg>\");\n return sb.join(\"\");\n }\n }]);\n\n return RRDiagram;\n}();\n\nexports.default = RRDiagram;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrtext = __webpack_require__(52);\n\nvar _rrtext2 = _interopRequireDefault(_rrtext);\n\nvar _rrdiagram = __webpack_require__(59);\n\nvar _rrdiagram2 = _interopRequireDefault(_rrdiagram);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BoxShape = {\n RECTANGLE: 1,\n ROUNDED_RECTANGLE: 2,\n HEXAGON: 3\n};\n\nvar RRDiagramToSVG = function () {\n _createClass(RRDiagramToSVG, null, [{\n key: 'BoxShape',\n get: function get() {\n return BoxShape;\n }\n }]);\n\n function RRDiagramToSVG() {\n _classCallCheck(this, RRDiagramToSVG);\n\n this.cssConnectorClass = \"rrConnector\"; //{fill:none;stroke:#222222;}\n this.cssRuleClass = \"rrRule\"; //{fill:#d3f0ff;stroke:#222222;}\n this.cssRuleTextClass = \"rrRuleText\"; //{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\n this.cssLiteralClass = \"rrLiteral\"; //{fill:#90d9ff;stroke:#222222;}\n this.cssLiteralTextClass = \"rrLiteralText\"; //{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\n this.cssSpecialSequenceClass = \"rrSpecialSequence\"; //{fill:#e4f4ff;stroke:#222222;}\n this.cssSpecialSequenceTextClass = \"rrSpecialSequenceText\"; //{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\n this.cssLoopCardinalitiesTextClass = \"rrLoopCardinalities\"; //{fill:#000000;font-family:Verdana,Sans-serif;font-size:10px;}\n this.ruleShape = BoxShape.RECTANGLE;\n this.literalShape = BoxShape.ROUNDED_RECTANGLE;\n this.specialSequenceShape = BoxShape.HEXAGON;\n }\n\n /**\r\n * @param {RRDiagram} rrDiagram \r\n * @return {string}\r\n */\n\n\n _createClass(RRDiagramToSVG, [{\n key: 'convert',\n value: function convert(rrDiagram) {\n return rrDiagram.toSVG(this);\n }\n }]);\n\n return RRDiagramToSVG;\n}();\n\nexports.default = RRDiagramToSVG;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(18);\nvar toLength = __webpack_require__(6);\nvar toAbsoluteIndex = __webpack_require__(44);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(2);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(13);\nvar redefineAll = __webpack_require__(42);\nvar meta = __webpack_require__(35);\nvar forOf = __webpack_require__(37);\nvar anInstance = __webpack_require__(36);\nvar isObject = __webpack_require__(4);\nvar fails = __webpack_require__(3);\nvar $iterDetect = __webpack_require__(66);\nvar setToStringTag = __webpack_require__(49);\nvar inheritIfRequired = __webpack_require__(93);\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n__webpack_require__(148);\nvar redefine = __webpack_require__(13);\nvar hide = __webpack_require__(12);\nvar fails = __webpack_require__(3);\nvar defined = __webpack_require__(27);\nvar wks = __webpack_require__(5);\nvar regexpExec = __webpack_require__(101);\n\nvar SPECIES = wks('species');\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n // #replace needs built-in support for named groups.\n // #match works fine because it just return the exec results, even if it has\n // a \"grops\" property.\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$<a>') !== '7';\n});\n\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {\n // Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length === 2 && result[0] === 'a' && result[1] === 'b';\n})();\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n re.exec = function () { execCalled = true; return null; };\n if (KEY === 'split') {\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n }\n re[SYMBOL]('');\n return !execCalled;\n }) : undefined;\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||\n (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var fns = exec(\n defined,\n SYMBOL,\n ''[KEY],\n function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {\n if (regexp.exec === regexpExec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n }\n );\n var strfn = fns[0];\n var rxfn = fns[1];\n\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(19);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.8 IsRegExp(argument)\nvar isObject = __webpack_require__(4);\nvar cof = __webpack_require__(19);\nvar MATCH = __webpack_require__(5)('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ITERATOR = __webpack_require__(5)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// Forced replacement prototype accessors methods\nmodule.exports = __webpack_require__(34) || !__webpack_require__(3)(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete __webpack_require__(2)[K];\n});\n\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nexports.f = Object.getOwnPropertySymbols;\n\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar classof = __webpack_require__(47);\nvar builtinExec = RegExp.prototype.exec;\n\n // `RegExpExec` abstract operation\n// https://tc39.github.io/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw new TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n if (classof(R) !== 'RegExp') {\n throw new TypeError('RegExp#exec called on incompatible receiver');\n }\n return builtinExec.call(R, S);\n};\n\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(10);\nvar ctx = __webpack_require__(21);\nvar forOf = __webpack_require__(37);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(23);\nvar defined = __webpack_require__(27);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar hide = __webpack_require__(12);\nvar uid = __webpack_require__(45);\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rule = __webpack_require__(58);\n\nvar _rule2 = _interopRequireDefault(_rule);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Grammar = function () {\n function Grammar(rules) {\n _classCallCheck(this, Grammar);\n\n if (arguments.length == 0) {\n rules = [];\n } else if (rules.constructor !== Array) {\n rules = arguments;\n }\n this.rules = rules;\n }\n\n /**\r\n * @return {Rule[]}\r\n */\n\n\n _createClass(Grammar, [{\n key: 'getRules',\n value: function getRules() {\n return this.rules;\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @return {string}\r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF) {\n var sb = [];\n for (var i = 0; i < this.rules.length; i++) {\n if (i > 0) {\n sb.push(\"\\n\");\n }\n sb.push(this.rules[i].toBNF(grammarToBNF));\n }\n return sb.join(\"\");\n }\n }]);\n\n return Grammar;\n}();\n\nexports.default = Grammar;\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _rrtext = __webpack_require__(52);\n\nvar _rrtext2 = _interopRequireDefault(_rrtext);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 Literal = function (_Expression) {\n _inherits(Literal, _Expression);\n\n /**\r\n * @param {string} text \r\n */\n function Literal(text) {\n _classCallCheck(this, Literal);\n\n var _this = _possibleConstructorReturn(this, (Literal.__proto__ || Object.getPrototypeOf(Literal)).call(this));\n\n _this.text = text;\n return _this;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n\n _createClass(Literal, [{\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n return new _rrtext2.default(_rrtext2.default.Type.LITERAL, this.text, null);\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n var c = grammarToBNF.literalDefinitionSign == _grammartobnf2.default.LiteralDefinitionSign.DOUBLE_QUOTE ? '\"' : '\\'';\n sb.push(c);\n sb.push(this.text);\n sb.push(c);\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof Literal)) {\n return false;\n }\n return this.text == o.text;\n }\n }]);\n\n return Literal;\n}(_expression2.default);\n\nexports.default = Literal;\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _rrchoice = __webpack_require__(81);\n\nvar _rrchoice2 = _interopRequireDefault(_rrchoice);\n\nvar _rrline = __webpack_require__(115);\n\nvar _rrline2 = _interopRequireDefault(_rrline);\n\nvar _rrloop = __webpack_require__(82);\n\nvar _rrloop2 = _interopRequireDefault(_rrloop);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 Repetition = function (_Expression) {\n _inherits(Repetition, _Expression);\n\n /**\r\n * @param {Expression} expression \r\n * @param {number} minRepetitionCount \r\n * @param {?number} maxRepetitionCount \r\n */\n function Repetition(expression, minRepetitionCount, maxRepetitionCount) {\n _classCallCheck(this, Repetition);\n\n var _this = _possibleConstructorReturn(this, (Repetition.__proto__ || Object.getPrototypeOf(Repetition)).call(this));\n\n _this.expression = expression;\n _this.minRepetitionCount = minRepetitionCount | 0;\n _this.maxRepetitionCount = maxRepetitionCount;\n return _this;\n }\n\n /**\r\n * @return {Expression}\r\n */\n\n\n _createClass(Repetition, [{\n key: 'getExpression',\n value: function getExpression() {\n return this.expression;\n }\n\n /**\r\n * @return {number}\r\n */\n\n }, {\n key: 'getMinRepetitionCount',\n value: function getMinRepetitionCount() {\n return this.minRepetitionCount;\n }\n\n /**\r\n * @return {?number}\r\n */\n\n }, {\n key: 'getMaxRepetitionCount',\n value: function getMaxRepetitionCount() {\n return this.maxRepetitionCount;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n }, {\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n var rrElement = this.expression.toRRElement(grammarToRRDiagram);\n if (this.minRepetitionCount == 0) {\n if (this.maxRepetitionCount == null || this.maxRepetitionCount > 1) {\n return new _rrchoice2.default(new _rrloop2.default(rrElement, null, 0, this.maxRepetitionCount == null ? null : this.maxRepetitionCount - 1), new _rrline2.default());\n }\n return new _rrchoice2.default(rrElement, new _rrline2.default());\n }\n return new _rrloop2.default(rrElement, null, this.minRepetitionCount - 1, this.maxRepetitionCount == null ? null : this.maxRepetitionCount - 1);\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n var isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\n if (this.maxRepetitionCount == null) {\n if (this.minRepetitionCount > 0) {\n if (this.minRepetitionCount == 1 && isUsingMultiplicationTokens) {\n this.expression.toBNF(grammarToBNF, sb, true);\n sb.push(\"+\");\n } else {\n if (isNested) {\n sb.push(\"( \");\n }\n if (this.minRepetitionCount > 1) {\n sb.push(this.minRepetitionCount, \" * \");\n }\n this.expression.toBNF(grammarToBNF, sb, false);\n if (grammarToBNF.isCommaSeparator) {\n sb.push(\" ,\");\n }\n sb.push(\" \", \"{ \");\n this.expression.toBNF(grammarToBNF, sb, false);\n sb.push(\" }\");\n if (isNested) {\n sb.push(\" )\");\n }\n }\n } else {\n if (isUsingMultiplicationTokens) {\n this.expression.toBNF(grammarToBNF, sb, true);\n sb.push(\"*\");\n } else {\n sb.push(\"{ \");\n this.expression.toBNF(grammarToBNF, sb, false);\n sb.push(\" }\");\n }\n }\n } else {\n if (this.minRepetitionCount == 0) {\n if (this.maxRepetitionCount == 1 && isUsingMultiplicationTokens) {\n this.expression.toBNF(grammarToBNF, sb, true);\n sb.push(\"?\");\n } else {\n if (this.maxRepetitionCount > 1) {\n sb.push(this.maxRepetitionCount, \" * \");\n }\n sb.push(\"[ \");\n this.expression.toBNF(grammarToBNF, sb, false);\n sb.push(\" ]\");\n }\n } else {\n if (this.minRepetitionCount == this.maxRepetitionCount) {\n sb.push(this.minRepetitionCount, \" * \");\n this.expression.toBNF(grammarToBNF, sb, isNested);\n } else {\n if (isNested) {\n sb.push(\"( \");\n }\n sb.push(this.minRepetitionCount, \" * \");\n this.expression.toBNF(grammarToBNF, sb, false);\n if (grammarToBNF.isCommaSeparator) {\n sb.push(\" ,\");\n }\n sb.push(\" \", this.maxRepetitionCount - this.minRepetitionCount, \" * \", \"[ \");\n this.expression.toBNF(grammarToBNF, sb, false);\n sb.push(\" ]\");\n if (isNested) {\n sb.push(\" )\");\n }\n }\n }\n }\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof Repetition)) {\n return false;\n }\n return this.expression.equals(o.expression) && this.minRepetitionCount == o.minRepetitionCount && this.maxRepetitionCount == null ? o.maxRepetitionCount == null : this.maxRepetitionCount.equals(o.maxRepetitionCount);\n }\n }]);\n\n return Repetition;\n}(_expression2.default);\n\nexports.default = Repetition;\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _rrbreak = __webpack_require__(80);\n\nvar _rrbreak2 = _interopRequireDefault(_rrbreak);\n\nvar _rrtext = __webpack_require__(52);\n\nvar _rrtext2 = _interopRequireDefault(_rrtext);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RuleReference = function (_Expression) {\n _inherits(RuleReference, _Expression);\n\n /**\r\n * @param {string} ruleName \r\n */\n function RuleReference(ruleName) {\n _classCallCheck(this, RuleReference);\n\n var _this = _possibleConstructorReturn(this, (RuleReference.__proto__ || Object.getPrototypeOf(RuleReference)).call(this));\n\n _this.ruleName = ruleName;\n return _this;\n }\n\n _createClass(RuleReference, [{\n key: 'getRuleName',\n value: function getRuleName() {\n return this.ruleName;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n }, {\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n var ruleConsideredAsLineBreak = grammarToRRDiagram.ruleConsideredAsLineBreak;\n if (ruleConsideredAsLineBreak != null && ruleConsideredAsLineBreak === this.ruleName) {\n return new _rrbreak2.default();\n }\n var ruleLinkProvider = grammarToRRDiagram.ruleLinkProvider;\n return new _rrtext2.default(_rrtext2.default.Type.RULE, this.ruleName, ruleLinkProvider == null ? null : ruleLinkProvider(this.ruleName));\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n sb.push(this.ruleName);\n var ruleConsideredAsLineBreak = grammarToBNF.ruleConsideredAsLineBreak;\n if (ruleConsideredAsLineBreak != null && ruleConsideredAsLineBreak === this.ruleName) {\n sb.push(\"\\n\");\n }\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof RuleReference)) {\n return false;\n }\n return this.ruleName == o.ruleName;\n }\n }]);\n\n return RuleReference;\n}(_expression2.default);\n\nexports.default = RuleReference;\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _rrloop = __webpack_require__(82);\n\nvar _rrloop2 = _interopRequireDefault(_rrloop);\n\nvar _rrsequence = __webpack_require__(83);\n\nvar _rrsequence2 = _interopRequireDefault(_rrsequence);\n\nvar _rulereference = __webpack_require__(78);\n\nvar _rulereference2 = _interopRequireDefault(_rulereference);\n\nvar _repetition = __webpack_require__(77);\n\nvar _repetition2 = _interopRequireDefault(_repetition);\n\nvar _literal = __webpack_require__(76);\n\nvar _literal2 = _interopRequireDefault(_literal);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 Sequence = function (_Expression) {\n _inherits(Sequence, _Expression);\n\n /**\r\n * @param {(Expression | Expression[])} expressions \r\n */\n function Sequence(expressions) {\n _classCallCheck(this, Sequence);\n\n var _this = _possibleConstructorReturn(this, (Sequence.__proto__ || Object.getPrototypeOf(Sequence)).call(this));\n\n if (arguments.length == 0) {\n expressions = [];\n } else if (expressions.constructor !== Array) {\n expressions = arguments;\n }\n _this.expressions = expressions;\n return _this;\n }\n\n /**\r\n * @param {Expression[]}\r\n */\n\n\n _createClass(Sequence, [{\n key: 'getExpressions',\n value: function getExpressions() {\n return this.expressions;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n }, {\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n var rrElementList = [];\n for (var i = 0; i < this.expressions.length; i++) {\n var expression = this.expressions[i];\n var rrElement = expression.toRRElement(grammarToRRDiagram);\n // Treat special case of: \"a (',' a)*\" and \"a (a)*\"\n if (i < this.expressions.length - 1 && this.expressions[i + 1] instanceof _repetition2.default) {\n var repetition = this.expressions[i + 1];\n var repetitionExpression = repetition.getExpression();\n if (repetitionExpression instanceof Sequence) {\n // Treat special case of: \"expr (',' expr)*\"\n var subExpressions = repetitionExpression.getExpressions();\n if (subExpressions.length == 2 && subExpressions[0] instanceof _literal2.default) {\n if (expression.equals(subExpressions[1])) {\n var maxRepetitionCount = repetition.getMaxRepetitionCount();\n if (maxRepetitionCount == null || maxRepetitionCount > 1) {\n rrElement = new _rrloop2.default(expression.toRRElement(grammarToRRDiagram), subExpressions[0].toRRElement(grammarToRRDiagram), repetition.getMinRepetitionCount(), maxRepetitionCount == null ? null : maxRepetitionCount);\n i++;\n }\n }\n }\n } else if (expression instanceof _rulereference2.default) {\n var ruleLink = expression;\n // Treat special case of: a (a)*\n if (repetitionExpression instanceof _rulereference2.default && repetitionExpression.getRuleName().equals(ruleLink.getRuleName())) {\n var _maxRepetitionCount = repetition.getMaxRepetitionCount();\n if (_maxRepetitionCount == null || _maxRepetitionCount > 1) {\n rrElement = new _rrloop2.default(ruleLink.toRRElement(grammarToRRDiagram), null, repetition.getMinRepetitionCount(), _maxRepetitionCount == null ? null : _maxRepetitionCount);\n i++;\n }\n }\n }\n }\n rrElementList.push(rrElement);\n }\n return new _rrsequence2.default(rrElementList);\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n if (this.expressions.length == 0) {\n sb.push(\"( )\");\n return;\n }\n if (isNested && this.expressions.length > 1) {\n sb.push(\"( \");\n }\n var isCommaSeparator = grammarToBNF.isCommaSeparator;\n for (var i = 0; i < this.expressions.length; i++) {\n if (i > 0) {\n if (isCommaSeparator) {\n sb.push(\" ,\");\n }\n sb.push(\" \");\n }\n this.expressions[i].toBNF(grammarToBNF, sb, this.expressions.length == 1 && isNested || !isCommaSeparator);\n }\n if (isNested && this.expressions.length > 1) {\n sb.push(\" )\");\n }\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof Sequence)) {\n return false;\n }\n if (this.expressions.length != o.expressions.length) {\n return false;\n }\n for (var i = 0; i < this.expressions.length; i++) {\n if (!this.expressions[i].equals(o.expressions[i])) {\n return false;\n }\n }\n return true;\n }\n }]);\n\n return Sequence;\n}(_expression2.default);\n\nexports.default = Sequence;\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RRBreak = function (_RRElement) {\n _inherits(RRBreak, _RRElement);\n\n function RRBreak() {\n _classCallCheck(this, RRBreak);\n\n return _possibleConstructorReturn(this, (RRBreak.__proto__ || Object.getPrototypeOf(RRBreak)).call(this));\n }\n\n _createClass(RRBreak, [{\n key: \"computeLayoutInfo\",\n value: function computeLayoutInfo(rrDiagramToSVG) {\n throw \"This element must not be nested and should have been processed before entering generation.\";\n }\n }, {\n key: \"toSVG\",\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\n throw \"This element must not be nested and should have been processed before entering generation.\";\n }\n }]);\n\n return RRBreak;\n}(_rrelement2.default);\n\nexports.default = RRBreak;\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _layoutinfo = __webpack_require__(51);\n\nvar _layoutinfo2 = _interopRequireDefault(_layoutinfo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RRChoice = function (_RRElement) {\n _inherits(RRChoice, _RRElement);\n\n /**\r\n * @param {(RRElement[] | RRElement)} rrElements \r\n */\n function RRChoice(rrElements) {\n _classCallCheck(this, RRChoice);\n\n var _this = _possibleConstructorReturn(this, (RRChoice.__proto__ || Object.getPrototypeOf(RRChoice)).call(this));\n\n if (arguments.length == 0) {\n rrElements = [];\n } else if (rrElements.constructor !== Array) {\n rrElements = arguments;\n }\n _this.rrElements = rrElements;\n return _this;\n }\n\n _createClass(RRChoice, [{\n key: 'computeLayoutInfo',\n value: function computeLayoutInfo(rrDiagramToSVG) {\n var width = 0;\n var height = 0;\n var connectorOffset = 0;\n for (var i = 0; i < this.rrElements.length; i++) {\n var rrElement = this.rrElements[i];\n rrElement.computeLayoutInfo(rrDiagramToSVG);\n var layoutInfo = rrElement.getLayoutInfo();\n if (i == 0) {\n connectorOffset = layoutInfo.getConnectorOffset();\n } else {\n height += 5;\n }\n height += layoutInfo.getHeight();\n width = Math.max(width, layoutInfo.getWidth());\n }\n width += 20 + 20;\n this.setLayoutInfo(new _layoutinfo2.default(width, height, connectorOffset));\n }\n }, {\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\n var layoutInfo = this.getLayoutInfo();\n var y1 = yOffset + layoutInfo.getConnectorOffset();\n var x1 = xOffset + 10;\n var x2 = xOffset + layoutInfo.getWidth() - 10;\n var xOffset2 = xOffset + 20;\n var y2 = 0;\n var yOffset2 = yOffset;\n for (var i = 0; i < this.rrElements.length; i++) {\n var rrElement = this.rrElements[i];\n var layoutInfo2 = rrElement.getLayoutInfo();\n var width = layoutInfo2.getWidth();\n var height = layoutInfo2.getHeight();\n y2 = yOffset2 + layoutInfo2.getConnectorOffset();\n if (i == 0) {\n // Line to first element\n svgContent.addLineConnector(x1 - 10, y1, x1 + 10, y1);\n } else {\n if (i == this.rrElements.length - 1) {\n // Curve and vertical down\n svgContent.addPathConnector(x1 - 5, y1, \"q5 0 5 5\", x1, y1 + 5);\n svgContent.addLineConnector(x1, y1 + 5, x1, y2 - 5);\n }\n // Curve and horizontal line to element\n svgContent.addPathConnector(x1, y2 - 5, \"q0 5 5 5\", x1 + 5, y2);\n svgContent.addLineConnector(x1 + 5, y2, xOffset2, y2);\n }\n rrElement.toSVG(rrDiagramToSVG, xOffset2, yOffset2, svgContent);\n if (i == 0) {\n // Line to first element\n svgContent.addLineConnector(xOffset2 + width, y2, x2 + 10, y2);\n } else {\n // Horizontal line to element and curve\n svgContent.addLineConnector(x2 - 5, y2, xOffset2 + width, y2);\n svgContent.addPathConnector(x2 - 5, y2, \"q5 0 5-5\", x2, y2 - 5);\n if (i == this.rrElements.length - 1) {\n // Vertical up and curve\n svgContent.addLineConnector(x2, y2 - 5, x2, y1 + 5);\n svgContent.addPathConnector(x2, y1 + 5, \"q0-5 5-5\", x2 + 5, y1);\n }\n }\n yOffset2 += height + 5;\n }\n }\n }]);\n\n return RRChoice;\n}(_rrelement2.default);\n\nexports.default = RRChoice;\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _rrdiagramtosvg = __webpack_require__(60);\n\nvar _rrdiagramtosvg2 = _interopRequireDefault(_rrdiagramtosvg);\n\nvar _layoutinfo = __webpack_require__(51);\n\nvar _layoutinfo2 = _interopRequireDefault(_layoutinfo);\n\nvar _utils = __webpack_require__(84);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RRLoop = function (_RRElement) {\n _inherits(RRLoop, _RRElement);\n\n /**\r\n * @param {RRElement} rrElement \r\n * @param {RRElement} loopElement \r\n * @param {?number} minRepetitionCount \r\n * @param {?number} maxRepetitionCount \r\n */\n function RRLoop(rrElement, loopElement, minRepetitionCount, maxRepetitionCount) {\n _classCallCheck(this, RRLoop);\n\n var _this = _possibleConstructorReturn(this, (RRLoop.__proto__ || Object.getPrototypeOf(RRLoop)).call(this));\n\n _this.rrElement = rrElement;\n _this.loopElement = loopElement;\n if (minRepetitionCount < 0) {\n throw new IllegalArgumentException(\"Minimum repetition must be positive!\");\n }\n if (maxRepetitionCount != null && maxRepetitionCount < minRepetitionCount) {\n throw new IllegalArgumentException(\"Maximum repetition must not be smaller than minimum!\");\n }\n _this.minRepetitionCount = minRepetitionCount;\n _this.maxRepetitionCount = maxRepetitionCount;\n _this.cardinalitiesText = null;\n _this.cardinalitiesWidth = null;\n _this.fontYOffset = null;\n return _this;\n }\n\n _createClass(RRLoop, [{\n key: 'computeLayoutInfo',\n value: function computeLayoutInfo(rrDiagramToSVG) {\n this.cardinalitiesText = null;\n this.cardinalitiesWidth = 0;\n this.fontYOffset = 0;\n if (this.minRepetitionCount > 0 || this.maxRepetitionCount != null) {\n this.cardinalitiesText = this.minRepetitionCount + \"..\" + (this.maxRepetitionCount == null ? \"N\" : this.maxRepetitionCount);\n // TODO: get font from CSS tag.\n var fontInfo = (0, _utils.getFontInfo)(this.cardinalitiesText, rrDiagramToSVG.cssLoopCardinalitiesTextClass);\n this.fontYOffset = fontInfo.descent;\n this.cardinalitiesWidth = fontInfo.textWidth + 2;\n }\n this.rrElement.computeLayoutInfo(rrDiagramToSVG);\n var layoutInfo1 = this.rrElement.getLayoutInfo();\n var width = layoutInfo1.getWidth();\n var height = layoutInfo1.getHeight();\n var connectorOffset = layoutInfo1.getConnectorOffset();\n if (this.loopElement != null) {\n this.loopElement.computeLayoutInfo(rrDiagramToSVG);\n var layoutInfo2 = this.loopElement.getLayoutInfo();\n width = Math.max(width, layoutInfo2.getWidth());\n var height2 = layoutInfo2.getHeight();\n height += 5 + height2;\n connectorOffset += 5 + height2;\n } else {\n height += 15;\n connectorOffset += 15;\n }\n width += 20 + 20 + this.cardinalitiesWidth;\n this.setLayoutInfo(new _layoutinfo2.default(width, height, connectorOffset));\n }\n }, {\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\n var layoutInfo1 = this.rrElement.getLayoutInfo();\n var width1 = layoutInfo1.getWidth();\n var maxWidth = width1;\n var yOffset2 = yOffset;\n var layoutInfo = this.getLayoutInfo();\n var connectorOffset = layoutInfo.getConnectorOffset();\n var y1 = yOffset;\n var loopOffset = 0;\n var loopWidth = 0;\n if (this.loopElement != null) {\n var layoutInfo2 = this.loopElement.getLayoutInfo();\n loopWidth = layoutInfo2.getWidth();\n maxWidth = Math.max(maxWidth, loopWidth);\n loopOffset = xOffset + 20 + Math.floor((maxWidth - loopWidth) / 2);\n yOffset2 += 5 + layoutInfo2.getHeight();\n y1 += layoutInfo2.getConnectorOffset();\n } else {\n yOffset2 += 15;\n y1 += 5;\n }\n var x1 = xOffset + 10;\n var x2 = xOffset + 20 + maxWidth + 10 + this.cardinalitiesWidth;\n var y2 = yOffset + connectorOffset;\n svgContent.addLineConnector(x1 - 10, y2, x1 + 10 + Math.floor((maxWidth - width1) / 2), y2);\n var loopPathStartX = x1 + 5;\n svgContent.addPathConnector(x1 + 5, y2, \"q-5 0-5-5\", x1, y2 - 5);\n svgContent.addLineConnector(x1, y2 - 5, x1, y1 + 5);\n svgContent.addPathConnector(x1, y1 + 5, \"q0-5 5-5\", x1 + 5, y1);\n if (this.loopElement != null) {\n svgContent.addLineConnector(x1 + 5, y1, loopOffset, y1);\n this.loopElement.toSVG(rrDiagramToSVG, loopOffset, yOffset, svgContent);\n loopPathStartX = loopOffset + loopWidth;\n }\n svgContent.addLineConnector(loopPathStartX, y1, x2 - 5, y1);\n svgContent.addPathConnector(x2 - 5, y1, \"q5 0 5 5\", x2, y1 + 5);\n svgContent.addLineConnector(x2, y1 + 5, x2, y2 - 5);\n svgContent.addPathConnector(x2, y2 - 5, \"q0 5-5 5\", x2 - 5, y2);\n if (this.cardinalitiesText != null) {\n svgContent.addElement(\"<text class=\\\"\" + (0, _utils.escapeXml)(rrDiagramToSVG.cssLoopCardinalitiesTextClass) + \"\\\" x=\\\"\" + (x2 - this.cardinalitiesWidth) + \"\\\" y=\\\"\" + (y2 - this.fontYOffset - 5) + \"\\\">\" + (0, _utils.escapeXml)(this.cardinalitiesText) + \"</text>\");\n }\n this.rrElement.toSVG(rrDiagramToSVG, xOffset + 20 + Math.floor((maxWidth - width1) / 2), yOffset2, svgContent);\n svgContent.addLineConnector(x2 - this.cardinalitiesWidth - 10 - Math.floor((maxWidth - width1) / 2), y2, xOffset + layoutInfo.getWidth(), y2);\n }\n }]);\n\n return RRLoop;\n}(_rrelement2.default);\n\nexports.default = RRLoop;\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _layoutinfo = __webpack_require__(51);\n\nvar _layoutinfo2 = _interopRequireDefault(_layoutinfo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RRSequence = function (_RRElement) {\n _inherits(RRSequence, _RRElement);\n\n /**\r\n * @param {(RRElement | RRElement[])} rrElements \r\n */\n function RRSequence(rrElements) {\n _classCallCheck(this, RRSequence);\n\n var _this = _possibleConstructorReturn(this, (RRSequence.__proto__ || Object.getPrototypeOf(RRSequence)).call(this));\n\n if (arguments.length == 0) {\n rrElements = [];\n } else if (rrElements.constructor !== Array) {\n rrElements = arguments;\n }\n _this.rrElements = rrElements;\n return _this;\n }\n\n _createClass(RRSequence, [{\n key: 'getRRElements',\n value: function getRRElements() {\n return this.rrElements;\n }\n }, {\n key: 'computeLayoutInfo',\n value: function computeLayoutInfo(rrDiagramToSVG) {\n var width = 0;\n var aboveConnector = 0;\n var belowConnector = 0;\n for (var i = 0; i < this.rrElements.length; i++) {\n var rrElement = this.rrElements[i];\n rrElement.computeLayoutInfo(rrDiagramToSVG);\n if (i > 0) {\n width += 10;\n }\n var layoutInfo = rrElement.getLayoutInfo();\n width += layoutInfo.getWidth();\n var height = layoutInfo.getHeight();\n var connectorOffset = layoutInfo.getConnectorOffset();\n aboveConnector = Math.max(aboveConnector, connectorOffset);\n belowConnector = Math.max(belowConnector, height - connectorOffset);\n }\n this.setLayoutInfo(new _layoutinfo2.default(width, aboveConnector + belowConnector, aboveConnector));\n }\n }, {\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\n var layoutInfo = this.getLayoutInfo();\n var connectorOffset = layoutInfo.getConnectorOffset();\n var widthOffset = 0;\n for (var i = 0; i < this.rrElements.length; i++) {\n var rrElement = this.rrElements[i];\n var layoutInfo2 = rrElement.getLayoutInfo();\n var width2 = layoutInfo2.getWidth();\n var connectorOffset2 = layoutInfo2.getConnectorOffset();\n var xOffset2 = widthOffset + xOffset;\n var yOffset2 = yOffset + connectorOffset - connectorOffset2;\n if (i > 0) {\n svgContent.addLineConnector(xOffset2 - 10, yOffset + connectorOffset, xOffset2, yOffset + connectorOffset);\n }\n rrElement.toSVG(rrDiagramToSVG, xOffset2, yOffset2, svgContent);\n widthOffset += 10;\n widthOffset += width2;\n }\n }\n }]);\n\n return RRSequence;\n}(_rrelement2.default);\n\nexports.default = RRSequence;\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.escapeXml = escapeXml;\nexports.getFontInfo = getFontInfo;\n/**\r\n * @param {string} unsafe \r\n * @return {string}\r\n */\nfunction escapeXml(unsafe) {\n return unsafe.replace(/[<>&'\"]/g, function (c) {\n switch (c) {\n case '<':\n return '&lt;';\n case '>':\n return '&gt;';\n case '&':\n return '&amp;';\n case '\\'':\n return '&apos;';\n case '\"':\n return '&quot;';\n }\n });\n}\n\n/**\r\n * @param {string} text\r\n * @param {string} fontCssClass\r\n * @return {{textWidth: number, textHeight: number, descent: number, height: number}}\r\n */\nfunction getFontInfo(text, fontCssClass) {\n // TODO: add caching of fontInfo per CssClass\n // Code inspired from: https://galactic.ink/journal/2011/01/html5-typographic-metrics/\n var container = document.body;\n var testDiv = document.createElement(\"div\");\n testDiv.className = fontCssClass;\n container.appendChild(testDiv);\n var computedStyle = window.getComputedStyle(testDiv, null);\n var fontSize = computedStyle.getPropertyValue('font-size');\n var fontFamily = computedStyle.getPropertyValue('font-family');\n container.removeChild(testDiv);\n var parent = document.createElement(\"div\");\n parent.style.fontFamily = fontFamily;\n parent.style.fontSize = fontSize;\n var image = document.createElement(\"img\");\n image.width = 1;\n image.height = 1;\n //image.src = \"./media/1x1.png\";\n image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGP6DwABBQECz6AuzQAAAABJRU5ErkJggg==';\n var sampleHeight = 500;\n var textNode = document.createTextNode(text);\n parent.appendChild(textNode);\n parent.appendChild(image);\n container.appendChild(parent);\n // getting css equivalent of ctx.measureText()\n image.style.display = \"none\";\n parent.style.display = \"inline\";\n var textHeight = parent.offsetHeight;\n var textWidth = parent.offsetWidth;\n // making sure super-wide text stays in-bounds\n image.style.display = \"inline\";\n var forceWidth = textWidth + image.offsetWidth;\n // capturing the \"top\" and \"bottom\" baseline\n parent.style.cssText = \"margin: \" + sampleHeight + \"px 0; display: block; width: \" + forceWidth + \"px; white-space: nowrap; overflow: hidden; position: absolute; top: 0;\";\n parent.style.fontFamily = fontFamily;\n parent.style.fontSize = fontSize;\n var descent = textHeight - image.offsetTop;\n var height = parent.offsetHeight;\n var fontInfo = {\n textWidth: textWidth,\n textHeight: textHeight,\n descent: descent,\n height: height\n };\n container.removeChild(parent);\n return fontInfo;\n}\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar at = __webpack_require__(72)(true);\n\n // `AdvanceStringIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? at(S, index).length : 1);\n};\n\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n\nvar toObject = __webpack_require__(9);\nvar toAbsoluteIndex = __webpack_require__(44);\nvar toLength = __webpack_require__(6);\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(161);\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $defineProperty = __webpack_require__(8);\nvar createDesc = __webpack_require__(41);\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nvar document = __webpack_require__(2).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar MATCH = __webpack_require__(5)('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar document = __webpack_require__(2).document;\nmodule.exports = document && document.documentElement;\n\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nvar setPrototypeOf = __webpack_require__(102).set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// check on default Array iterator\nvar Iterators = __webpack_require__(48);\nvar ITERATOR = __webpack_require__(5)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar create = __webpack_require__(38);\nvar descriptor = __webpack_require__(41);\nvar setToStringTag = __webpack_require__(49);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(12)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(34);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(13);\nvar hide = __webpack_require__(12);\nvar Iterators = __webpack_require__(48);\nvar $iterCreate = __webpack_require__(95);\nvar setToStringTag = __webpack_require__(49);\nvar getPrototypeOf = __webpack_require__(17);\nvar ITERATOR = __webpack_require__(5)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\n// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\n// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar macrotask = __webpack_require__(107).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(19)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(10);\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar regexpFlags = __webpack_require__(53);\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar LAST_INDEX = 'lastIndex';\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/,\n re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;\n})();\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + re.source + '$(?!\\\\s)', regexpFlags.call(re));\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];\n\n match = nativeExec.call(re, str);\n\n if (UPDATES_LAST_INDEX_WRONG && match) {\n re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n // eslint-disable-next-line no-loop-func\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(4);\nvar anObject = __webpack_require__(1);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(21)(Function.call, __webpack_require__(16).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar shared = __webpack_require__(56)('keys');\nvar uid = __webpack_require__(45);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = __webpack_require__(65);\nvar defined = __webpack_require__(27);\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar toInteger = __webpack_require__(23);\nvar defined = __webpack_require__(27);\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports) {\n\nmodule.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(21);\nvar invoke = __webpack_require__(126);\nvar html = __webpack_require__(92);\nvar cel = __webpack_require__(89);\nvar global = __webpack_require__(2);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(19)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(2);\nvar DESCRIPTORS = __webpack_require__(7);\nvar LIBRARY = __webpack_require__(34);\nvar $typed = __webpack_require__(73);\nvar hide = __webpack_require__(12);\nvar redefineAll = __webpack_require__(42);\nvar fails = __webpack_require__(3);\nvar anInstance = __webpack_require__(36);\nvar toInteger = __webpack_require__(23);\nvar toLength = __webpack_require__(6);\nvar toIndex = __webpack_require__(145);\nvar gOPN = __webpack_require__(39).f;\nvar dP = __webpack_require__(8).f;\nvar arrayFill = __webpack_require__(86);\nvar setToStringTag = __webpack_require__(49);\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar core = __webpack_require__(20);\nvar LIBRARY = __webpack_require__(34);\nvar wksExt = __webpack_require__(146);\nvar defineProperty = __webpack_require__(8).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar classof = __webpack_require__(47);\nvar ITERATOR = __webpack_require__(5)('iterator');\nvar Iterators = __webpack_require__(48);\nmodule.exports = __webpack_require__(20).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar addToUnscopables = __webpack_require__(33);\nvar step = __webpack_require__(129);\nvar Iterators = __webpack_require__(48);\nvar toIObject = __webpack_require__(18);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(96)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _chunk = __webpack_require__(156);\n\nvar _chunk2 = _interopRequireDefault(_chunk);\n\nvar _rule = __webpack_require__(58);\n\nvar _rule2 = _interopRequireDefault(_rule);\n\nvar _grammar = __webpack_require__(75);\n\nvar _grammar2 = _interopRequireDefault(_grammar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\r\n * @param {string} name\r\n * @param {Chunk} chunk\r\n * @param {string} originalExpressionText\r\n */\nfunction createRule(name, chunk, originalExpressionText) {\n chunk.prune();\n var expression = chunk.getExpression();\n var rule = new _rule2.default(name, expression, originalExpressionText);\n return rule;\n}\n\n/**\r\n * @param {Chunk} parentChunk\r\n * @param {function(): string} readNext\r\n * @param {string} stopChar\r\n * @return {string}\r\n */\nfunction loadExpression(parentChunk, readNext, stopChar) {\n var expressionTextSB = [];\n var lastChar = 0;\n var sb = [];\n var isFirst = true;\n var isInSpecialGroup = false;\n var specialGroupChar = 0;\n var isLiteral = parentChunk.getType() == _chunk2.default.ChunkType.LITERAL;\n for (var c; (c = readNext()) != -1;) {\n expressionTextSB.push(c);\n if (isLiteral) {\n if (c == stopChar) {\n var s = sb.join(\"\");\n parentChunk.setText(s);\n return expressionTextSB.join(\"\");\n }\n sb.push(c);\n } else {\n if (isFirst && parentChunk.getType() == _chunk2.default.ChunkType.GROUP) {\n switch (c) {\n case '*':\n isInSpecialGroup = true;\n specialGroupChar = c;\n break;\n case '?':\n isInSpecialGroup = true;\n specialGroupChar = c;\n break;\n }\n }\n isFirst = false;\n if (isInSpecialGroup) {\n if (c == ')' && lastChar == specialGroupChar) {\n // Mutate parent group\n switch (specialGroupChar) {\n case '*':\n parentChunk.setType(_chunk2.default.ChunkType.COMMENT);break;\n case '?':\n parentChunk.setType(_chunk2.default.ChunkType.SPECIAL_SEQUENCE);break;\n }\n var comment = sb.join(\"\");\n comment = comment.slice(1, comment.length - 1).trim();\n parentChunk.setText(comment);\n return expressionTextSB.join(\"\");\n }\n if (sb.length > 0 || !/\\s/.test(c)) {\n sb.push(c);\n }\n } else {\n if (c == stopChar) {\n var content = sb.join(\"\").trim();\n if (content.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, content));\n }\n return expressionTextSB.join(\"\");\n }\n switch (c) {\n case ',':\n case ' ':\n case '\\n':\n case '\\r':\n case '\\t':\n {\n var _content = sb.join(\"\").trim();\n if (_content.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content));\n }\n sb.length = 0;\n // parentChunk.addChunk(new Chunk(Chunk.ChunkType.CONCATENATION));\n break;\n }\n case '|':\n {\n var _content2 = sb.join(\"\").trim();\n if (_content2.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content2));\n }\n sb.length = 0;\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.ALTERNATION));\n break;\n }\n case '*':\n case '+':\n case '?':\n {\n var _content3 = sb.join(\"\").trim();\n if (_content3.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content3));\n }\n sb.length = 0;\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.REPETITION_TOKEN, c));\n break;\n }\n case '\\\"':\n {\n var _content4 = sb.join(\"\").trim();\n if (_content4.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content4));\n }\n sb.length = 0;\n var literalChunk = new _chunk2.default(_chunk2.default.ChunkType.LITERAL);\n var subExpressionText = loadExpression(literalChunk, readNext, '\\\"');\n expressionTextSB.push(subExpressionText);\n parentChunk.addChunk(literalChunk);\n break;\n }\n case '\\'':\n {\n var _content5 = sb.join(\"\").trim();\n if (_content5.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content5));\n }\n sb.length = 0;\n var _literalChunk = new _chunk2.default(_chunk2.default.ChunkType.LITERAL);\n var _subExpressionText = loadExpression(_literalChunk, readNext, '\\'');\n expressionTextSB.push(_subExpressionText);\n parentChunk.addChunk(_literalChunk);\n break;\n }\n case '(':\n {\n var _content6 = sb.join(\"\").trim();\n if (_content6.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content6));\n }\n sb.length = 0;\n var groupChunk = new _chunk2.default(_chunk2.default.ChunkType.GROUP);\n var _subExpressionText2 = loadExpression(groupChunk, readNext, ')');\n expressionTextSB.push(_subExpressionText2);\n parentChunk.addChunk(groupChunk);\n break;\n }\n case '[':\n {\n var _content7 = sb.join(\"\").trim();\n if (_content7.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content7));\n }\n sb.length = 0;\n var optionChunk = new _chunk2.default(_chunk2.default.ChunkType.OPTION);\n var _subExpressionText3 = loadExpression(optionChunk, readNext, ']');\n expressionTextSB.push(_subExpressionText3);\n parentChunk.addChunk(optionChunk);\n break;\n }\n case '{':\n {\n var _content8 = sb.join(\"\").trim();\n if (_content8.length > 0) {\n parentChunk.addChunk(new _chunk2.default(_chunk2.default.ChunkType.RULE, _content8));\n }\n sb.length = 0;\n var repetitionChunk = new _chunk2.default(_chunk2.default.ChunkType.REPETITION);\n repetitionChunk.setMinCount(0);\n var _subExpressionText4 = loadExpression(repetitionChunk, readNext, '}');\n expressionTextSB.push(_subExpressionText4);\n parentChunk.addChunk(repetitionChunk);\n break;\n }\n default:\n {\n if (sb.length > 0 || !/\\s/.test(c)) {\n sb.push(c);\n }\n break;\n }\n }\n }\n lastChar = c;\n }\n }\n return expressionTextSB.join(\"\");\n}\n\nvar BNFToGrammar = function () {\n function BNFToGrammar() {\n _classCallCheck(this, BNFToGrammar);\n }\n\n _createClass(BNFToGrammar, [{\n key: 'convert',\n\n\n /**\r\n * @param {string} text \r\n * @return {Grammar}\r\n */\n value: function convert(text) {\n var readNext = function () {\n // all your code here\n var index = 0;\n return function () {\n if (index < text.length) {\n var char = text[index];\n index++;\n return char;\n }\n return -1;\n };\n }();\n var sb = [];\n var ruleList = [];\n for (var c; (c = readNext()) != -1;) {\n switch (c) {\n case '=':\n {\n var chunk = new _chunk2.default(_chunk2.default.ChunkType.GROUP);\n var expressionText = loadExpression(chunk, readNext, ';');\n if (expressionText.endsWith(\";\")) {\n expressionText = expressionText.slice(0, expressionText.length - 1);\n }\n var ruleName = sb.join(\"\");\n sb.length = 0;\n if (ruleName.endsWith(\":\")) {\n ruleName = ruleName.slice(0, ruleName.length - 1);\n if (ruleName.endsWith(\":\")) {\n ruleName = ruleName.slice(0, ruleName.length - 1);\n }\n }\n ruleName = ruleName.trim();\n var rule = createRule(ruleName, chunk, expressionText);\n ruleList.push(rule);\n break;\n }\n // Consider that '(' in rule name is start of a comment.\n case '(':\n {\n if (readNext() != '*') {\n throw \"Expecting start of a comment after '(' but could not find '*'!\";\n }\n var lastChar = 0;\n for (var c2; (c2 = readNext()) != -1;) {\n if (c2 == ')' && lastChar == '*') {\n break;\n }\n lastChar = c2;\n }\n break;\n }\n default:\n {\n if (!/\\s/.test(c) || sb.length > 0) {\n sb.push(c);\n }\n break;\n }\n }\n }\n return new _grammar2.default(ruleList);\n }\n }]);\n\n return BNFToGrammar;\n}();\n\nexports.default = BNFToGrammar;\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _sequence = __webpack_require__(79);\n\nvar _sequence2 = _interopRequireDefault(_sequence);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nvar _rrchoice = __webpack_require__(81);\n\nvar _rrchoice2 = _interopRequireDefault(_rrchoice);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 Choice = function (_Expression) {\n _inherits(Choice, _Expression);\n\n /**\r\n * @param {Expression | Expression[]} expressions \r\n */\n function Choice(expressions) {\n _classCallCheck(this, Choice);\n\n var _this = _possibleConstructorReturn(this, (Choice.__proto__ || Object.getPrototypeOf(Choice)).call(this));\n\n if (arguments.length == 0) {\n expressions = [];\n } else if (expressions.constructor !== Array) {\n expressions = arguments;\n }\n _this.expressions = expressions;\n return _this;\n }\n\n /**\r\n * @return {Expression[]}\r\n */\n\n\n _createClass(Choice, [{\n key: 'getExpressions',\n value: function getExpressions() {\n return this.expressions;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n }, {\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n var rrElements = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.expressions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var expression = _step.value;\n\n rrElements.push(expression.toRRElement(grammarToRRDiagram));\n }\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 return new _rrchoice2.default(rrElements);\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n var expressionList = [];\n var hasNoop = false;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = this.expressions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var expression = _step2.value;\n\n if (expression instanceof _sequence2.default && expression.getExpressions().length == 0) {\n hasNoop = true;\n } else {\n expressionList.push(expression);\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n if (expressionList.length == 0) {\n sb.push(\"( )\");\n } else if (hasNoop && expressionList.length == 1) {\n var isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\n if (!isUsingMultiplicationTokens) {\n sb.push(\"[ \");\n }\n expressionList[0].toBNF(grammarToBNF, sb, isUsingMultiplicationTokens);\n if (!isUsingMultiplicationTokens) {\n sb.push(\" ]\");\n }\n } else {\n var _isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\n if (hasNoop && !_isUsingMultiplicationTokens) {\n sb.push(\"[ \");\n } else if (hasNoop || isNested && expressionList.length > 1) {\n sb.push(\"( \");\n }\n var count = expressionList.length;\n for (var i = 0; i < count; i++) {\n if (i > 0) {\n sb.push(\" | \");\n }\n expressionList[i].toBNF(grammarToBNF, sb, false);\n }\n if (hasNoop && !_isUsingMultiplicationTokens) {\n sb.push(\" ]\");\n } else if (hasNoop || isNested && expressionList.length > 1) {\n sb.push(\" )\");\n if (hasNoop) {\n sb.push(\"?\");\n }\n }\n }\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof Choice)) {\n return false;\n }\n if (this.expressions.length != o.expressions.length) {\n return false;\n }\n for (var i = 0; i < this.expressions.length; i++) {\n if (!this.expressions[i].equals(o.expressions[i])) {\n return false;\n }\n }\n return true;\n }\n }]);\n\n return Choice;\n}(_expression2.default);\n\nexports.default = Choice;\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nvar _rrtext = __webpack_require__(52);\n\nvar _rrtext2 = _interopRequireDefault(_rrtext);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 SpecialSequence = function (_Expression) {\n _inherits(SpecialSequence, _Expression);\n\n /**\r\n * @param {string} text \r\n */\n function SpecialSequence(text) {\n _classCallCheck(this, SpecialSequence);\n\n var _this = _possibleConstructorReturn(this, (SpecialSequence.__proto__ || Object.getPrototypeOf(SpecialSequence)).call(this));\n\n _this.text = text;\n return _this;\n }\n\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\n\n\n _createClass(SpecialSequence, [{\n key: 'toRRElement',\n value: function toRRElement(grammarToRRDiagram) {\n return new _rrtext2.default(_rrtext2.default.Type.SPECIAL_SEQUENCE, this.text, null);\n }\n\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\n\n }, {\n key: 'toBNF',\n value: function toBNF(grammarToBNF, sb, isNested) {\n sb.push(\"(? \");\n sb.push(this.text);\n sb.push(\" ?)\");\n }\n\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\n\n }, {\n key: 'equals',\n value: function equals(o) {\n if (!(o instanceof SpecialSequence)) {\n return false;\n }\n return this.text == o.text;\n }\n }]);\n\n return SpecialSequence;\n}(_expression2.default);\n\nexports.default = SpecialSequence;\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _rrelement = __webpack_require__(11);\n\nvar _rrelement2 = _interopRequireDefault(_rrelement);\n\nvar _layoutinfo = __webpack_require__(51);\n\nvar _layoutinfo2 = _interopRequireDefault(_layoutinfo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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 RRLine = function (_RRElement) {\n _inherits(RRLine, _RRElement);\n\n function RRLine() {\n _classCallCheck(this, RRLine);\n\n return _possibleConstructorReturn(this, (RRLine.__proto__ || Object.getPrototypeOf(RRLine)).call(this));\n }\n\n _createClass(RRLine, [{\n key: 'computeLayoutInfo',\n value: function computeLayoutInfo(rrDiagramToSVG) {\n this.setLayoutInfo(new _layoutinfo2.default(0, 10, 5));\n }\n }, {\n key: 'toSVG',\n value: function toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {}\n }]);\n\n return RRLine;\n}(_rrelement2.default);\n\nexports.default = RRLine;\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar cof = __webpack_require__(19);\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n\nvar toObject = __webpack_require__(9);\nvar toAbsoluteIndex = __webpack_require__(44);\nvar toLength = __webpack_require__(6);\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar forOf = __webpack_require__(37);\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar aFunction = __webpack_require__(10);\nvar toObject = __webpack_require__(9);\nvar IObject = __webpack_require__(54);\nvar toLength = __webpack_require__(6);\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar aFunction = __webpack_require__(10);\nvar isObject = __webpack_require__(4);\nvar invoke = __webpack_require__(126);\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar dP = __webpack_require__(8).f;\nvar create = __webpack_require__(38);\nvar redefineAll = __webpack_require__(42);\nvar ctx = __webpack_require__(21);\nvar anInstance = __webpack_require__(36);\nvar forOf = __webpack_require__(37);\nvar $iterDefine = __webpack_require__(96);\nvar step = __webpack_require__(129);\nvar setSpecies = __webpack_require__(43);\nvar DESCRIPTORS = __webpack_require__(7);\nvar fastKey = __webpack_require__(35).fastKey;\nvar validate = __webpack_require__(46);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = __webpack_require__(47);\nvar from = __webpack_require__(118);\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar redefineAll = __webpack_require__(42);\nvar getWeak = __webpack_require__(35).getWeak;\nvar anObject = __webpack_require__(1);\nvar isObject = __webpack_require__(4);\nvar anInstance = __webpack_require__(36);\nvar forOf = __webpack_require__(37);\nvar createArrayMethod = __webpack_require__(26);\nvar $has = __webpack_require__(15);\nvar validate = __webpack_require__(46);\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = __webpack_require__(64);\nvar isObject = __webpack_require__(4);\nvar toLength = __webpack_require__(6);\nvar ctx = __webpack_require__(21);\nvar IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = !__webpack_require__(7) && !__webpack_require__(3)(function () {\n return Object.defineProperty(__webpack_require__(89)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports) {\n\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(4);\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(1);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.16 Math.fround(x)\nvar sign = __webpack_require__(98);\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n\n\n/***/ }),\n/* 131 */\n/***/ (function(module, exports) {\n\n// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = __webpack_require__(7);\nvar getKeys = __webpack_require__(40);\nvar gOPS = __webpack_require__(68);\nvar pIE = __webpack_require__(55);\nvar toObject = __webpack_require__(9);\nvar IObject = __webpack_require__(54);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(3)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(8);\nvar anObject = __webpack_require__(1);\nvar getKeys = __webpack_require__(40);\n\nmodule.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(18);\nvar gOPN = __webpack_require__(39).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar has = __webpack_require__(15);\nvar toIObject = __webpack_require__(18);\nvar arrayIndexOf = __webpack_require__(61)(false);\nvar IE_PROTO = __webpack_require__(103)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar DESCRIPTORS = __webpack_require__(7);\nvar getKeys = __webpack_require__(40);\nvar toIObject = __webpack_require__(18);\nvar isEnum = __webpack_require__(55).f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all object keys, includes non-enumerable and symbols\nvar gOPN = __webpack_require__(39);\nvar gOPS = __webpack_require__(68);\nvar anObject = __webpack_require__(1);\nvar Reflect = __webpack_require__(2).Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $parseFloat = __webpack_require__(2).parseFloat;\nvar $trim = __webpack_require__(50).trim;\n\nmodule.exports = 1 / $parseFloat(__webpack_require__(106) + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $parseInt = __webpack_require__(2).parseInt;\nvar $trim = __webpack_require__(50).trim;\nvar ws = __webpack_require__(106);\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(1);\nvar isObject = __webpack_require__(4);\nvar newPromiseCapability = __webpack_require__(100);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports) {\n\n// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = __webpack_require__(6);\nvar repeat = __webpack_require__(105);\nvar defined = __webpack_require__(27);\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n\n/***/ }),\n/* 145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = __webpack_require__(23);\nvar toLength = __webpack_require__(6);\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n\n\n/***/ }),\n/* 146 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports.f = __webpack_require__(5);\n\n\n/***/ }),\n/* 147 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(121);\nvar validate = __webpack_require__(46);\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(62)(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n\n/***/ }),\n/* 148 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar regexpExec = __webpack_require__(101);\n__webpack_require__(0)({\n target: 'RegExp',\n proto: true,\n forced: regexpExec !== /./.exec\n}, {\n exec: regexpExec\n});\n\n\n/***/ }),\n/* 149 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(7) && /./g.flags != 'g') __webpack_require__(8).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(53)\n});\n\n\n/***/ }),\n/* 150 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(121);\nvar validate = __webpack_require__(46);\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(62)(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n\n/***/ }),\n/* 151 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(2);\nvar each = __webpack_require__(26)(0);\nvar redefine = __webpack_require__(13);\nvar meta = __webpack_require__(35);\nvar assign = __webpack_require__(133);\nvar weak = __webpack_require__(123);\nvar isObject = __webpack_require__(4);\nvar validate = __webpack_require__(46);\nvar NATIVE_WEAK_MAP = __webpack_require__(46);\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = __webpack_require__(62)(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n\n/***/ }),\n/* 152 */\n/***/ (function(module, exports) {\n\nvar 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\n\n/***/ }),\n/* 153 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ui = exports.model = exports.bnfdisplay = undefined;\n\nvar _BNFDisplay = __webpack_require__(155);\n\nvar _BNFDisplay2 = _interopRequireDefault(_BNFDisplay);\n\nvar _bnftogrammar = __webpack_require__(112);\n\nvar _bnftogrammar2 = _interopRequireDefault(_bnftogrammar);\n\nvar _choice = __webpack_require__(113);\n\nvar _choice2 = _interopRequireDefault(_choice);\n\nvar _grammar = __webpack_require__(75);\n\nvar _grammar2 = _interopRequireDefault(_grammar);\n\nvar _grammartobnf = __webpack_require__(24);\n\nvar _grammartobnf2 = _interopRequireDefault(_grammartobnf);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _literal = __webpack_require__(76);\n\nvar _literal2 = _interopRequireDefault(_literal);\n\nvar _repetition = __webpack_require__(77);\n\nvar _repetition2 = _interopRequireDefault(_repetition);\n\nvar _rule = __webpack_require__(58);\n\nvar _rule2 = _interopRequireDefault(_rule);\n\nvar _rulereference = __webpack_require__(78);\n\nvar _rulereference2 = _interopRequireDefault(_rulereference);\n\nvar _sequence = __webpack_require__(79);\n\nvar _sequence2 = _interopRequireDefault(_sequence);\n\nvar _specialsequence = __webpack_require__(114);\n\nvar _specialsequence2 = _interopRequireDefault(_specialsequence);\n\nvar _rrbreak = __webpack_require__(80);\n\nvar _rrbreak2 = _interopRequireDefault(_rrbreak);\n\nvar _rrchoice = __webpack_require__(81);\n\nvar _rrchoice2 = _interopRequireDefault(_rrchoice);\n\nvar _rrdiagram = __webpack_require__(59);\n\nvar _rrdiagram2 = _interopRequireDefault(_rrdiagram);\n\nvar _rrdiagramtosvg = __webpack_require__(60);\n\nvar _rrdiagramtosvg2 = _interopRequireDefault(_rrdiagramtosvg);\n\nvar _rrline = __webpack_require__(115);\n\nvar _rrline2 = _interopRequireDefault(_rrline);\n\nvar _rrloop = __webpack_require__(82);\n\nvar _rrloop2 = _interopRequireDefault(_rrloop);\n\nvar _rrsequence = __webpack_require__(83);\n\nvar _rrsequence2 = _interopRequireDefault(_rrsequence);\n\nvar _rrtext = __webpack_require__(52);\n\nvar _rrtext2 = _interopRequireDefault(_rrtext);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar bnfdisplay = exports.bnfdisplay = {\n BNFDisplay: _BNFDisplay2.default\n};\n\nvar model = exports.model = {\n BNFToGrammar: _bnftogrammar2.default,\n Choice: _choice2.default,\n Grammar: _grammar2.default,\n GrammarToBNF: _grammartobnf2.default,\n GrammarToRRDiagram: _grammartorrdiagram2.default,\n Literal: _literal2.default,\n Repetition: _repetition2.default,\n Rule: _rule2.default,\n RuleReference: _rulereference2.default,\n Sequence: _sequence2.default,\n SpecialSequence: _specialsequence2.default\n};\n\nvar ui = exports.ui = {\n RRBreak: _rrbreak2.default,\n RRChoice: _rrchoice2.default,\n RRDiagram: _rrdiagram2.default,\n RRDiagramToSVG: _rrdiagramtosvg2.default,\n RRLine: _rrline2.default,\n RRLoop: _rrloop2.default,\n RRSequence: _rrsequence2.default,\n RRText: _rrtext2.default\n};\n\n/***/ }),\n/* 154 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {\n\n__webpack_require__(359);\n\n__webpack_require__(360);\n\n__webpack_require__(160);\n\nif (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = \"defineProperty\";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, \"padLeft\", \"\".padStart);\ndefine(String.prototype, \"padRight\", \"\".padEnd);\n\n\"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\".split(\",\").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(152)))\n\n/***/ }),\n/* 155 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _bnftogrammar = __webpack_require__(112);\n\nvar _bnftogrammar2 = _interopRequireDefault(_bnftogrammar);\n\nvar _grammartorrdiagram = __webpack_require__(25);\n\nvar _grammartorrdiagram2 = _interopRequireDefault(_grammartorrdiagram);\n\nvar _rrdiagramtosvg = __webpack_require__(60);\n\nvar _rrdiagramtosvg2 = _interopRequireDefault(_rrdiagramtosvg);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BNFDisplay = function () {\n function BNFDisplay() {\n _classCallCheck(this, BNFDisplay);\n\n this.bnfToGrammar = new _bnftogrammar2.default();\n this.grammarToRRDiagram = new _grammartorrdiagram2.default();\n this.grammarToRRDiagram.ruleConsideredAsLineBreak = \"\\\\\";\n this.rrDiagramToSVG = new _rrdiagramtosvg2.default();\n }\n\n /**\r\n * @return {BNFToGrammar}\r\n */\n\n\n _createClass(BNFDisplay, [{\n key: 'getBNFToGrammar',\n value: function getBNFToGrammar() {\n return this.bnfToGrammar;\n }\n\n /**\r\n * @return {GrammarToRRDiagram}\r\n */\n\n }, {\n key: 'getGrammarToRRDiagram',\n value: function getGrammarToRRDiagram() {\n return this.grammarToRRDiagram;\n }\n\n /**\r\n * @return {RRDiagramToSVG}\r\n */\n\n }, {\n key: 'getRRDiagramToSVG',\n value: function getRRDiagramToSVG() {\n return this.rrDiagramToSVG;\n }\n\n /**\r\n * @param {string} className\r\n * @param {string} newClassName\r\n */\n\n }, {\n key: 'replaceBNF',\n value: function replaceBNF(className, newClassName) {\n var elements = Array.from(document.getElementsByClassName(className));\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var element = _step.value;\n\n if (element.tagName.toLowerCase() === 'pre') {\n var newElement = document.createElement('div');\n // Give a dummy rule definition to satisfy parser.\n var bnf = element.innerHTML;\n var grammar = this.bnfToGrammar.convert('a = ' + bnf);\n var rules = grammar.getRules();\n if (rules.length == 1) {\n var rule = rules[0];\n var rrDiagram = this.grammarToRRDiagram.convert(rule);\n var svg = this.rrDiagramToSVG.convert(rrDiagram);\n var svgContainer = document.createElement('div');\n svgContainer.className = newClassName;\n svgContainer.innerHTML = svg;\n newElement.appendChild(svgContainer);\n } else {\n newElement.appendChild(document.createTextNode('Error while loading BNF: ' + bnf));\n }\n element.parentElement.replaceChild(newElement, element);\n }\n }\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 }]);\n\n return BNFDisplay;\n}();\n\nexports.default = BNFDisplay;\n\n/***/ }),\n/* 156 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _sequence = __webpack_require__(79);\n\nvar _sequence2 = _interopRequireDefault(_sequence);\n\nvar _specialsequence = __webpack_require__(114);\n\nvar _specialsequence2 = _interopRequireDefault(_specialsequence);\n\nvar _repetition = __webpack_require__(77);\n\nvar _repetition2 = _interopRequireDefault(_repetition);\n\nvar _rulereference = __webpack_require__(78);\n\nvar _rulereference2 = _interopRequireDefault(_rulereference);\n\nvar _choice = __webpack_require__(113);\n\nvar _choice2 = _interopRequireDefault(_choice);\n\nvar _literal = __webpack_require__(76);\n\nvar _literal2 = _interopRequireDefault(_literal);\n\nvar _expression = __webpack_require__(32);\n\nvar _expression2 = _interopRequireDefault(_expression);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ChunkType = {\n RULE: 'RULE',\n REPETITION_TOKEN: 'REPETITION_TOKEN',\n // CONCATENATION: 'CONCATENATION',\n ALTERNATION: 'ALTERNATION',\n GROUP: 'GROUP',\n COMMENT: 'COMMENT',\n SPECIAL_SEQUENCE: 'SPECIAL_SEQUENCE',\n LITERAL: 'LITERAL',\n OPTION: 'OPTION',\n REPETITION: 'REPETITION',\n CHOICE: 'CHOICE'\n};\n\n/**\r\n * @param {Expression} expression \r\n * @return {boolean}\r\n */\nfunction isNoop(expression) {\n return expression instanceof _sequence2.default && expression.getExpressions().length == 0;\n}\n\nvar Chunk = function () {\n _createClass(Chunk, null, [{\n key: 'ChunkType',\n get: function get() {\n return ChunkType;\n }\n }]);\n\n function Chunk(type, text) {\n _classCallCheck(this, Chunk);\n\n this.type = type;\n this.text = text;\n this.minCount = 0;\n this.maxCount = null;\n this.chunkList = null;\n }\n\n _createClass(Chunk, [{\n key: 'getType',\n value: function getType() {\n return this.type;\n }\n }, {\n key: 'setType',\n value: function setType(type) {\n this.type = type;\n }\n }, {\n key: 'setText',\n value: function setText(text) {\n this.text = text;\n }\n }, {\n key: 'setMinCount',\n value: function setMinCount(minCount) {\n this.minCount = minCount;\n }\n }, {\n key: 'setMaxCount',\n value: function setMaxCount(maxCount) {\n this.maxCount = maxCount;\n }\n }, {\n key: 'addChunk',\n value: function addChunk(chunk) {\n if (this.chunkList == null) {\n this.chunkList = [];\n }\n this.chunkList.push(chunk);\n }\n }, {\n key: 'prune',\n value: function prune() {\n var hasAlternation = false;\n for (var i = this.chunkList.length - 1; i >= 0; i--) {\n var chunk = this.chunkList[i];\n switch (chunk.getType()) {\n case ChunkType.REPETITION_TOKEN:\n {\n if (\"*\" === chunk.text) {\n this.chunkList.splice(i, 1);\n var previousChunk = this.chunkList[i - 1];\n var multiplier = null;\n // Case of: 3 * expression\n if (previousChunk.getType() == ChunkType.RULE) {\n multiplier = +previousChunk.text;\n if (isNaN(multiplier)) {\n multiplier = null;\n }\n }\n if (multiplier != null) {\n // The current one is removed, so next one is at index i.\n var nextChunk = this.chunkList[i];\n if (nextChunk.getType() == ChunkType.OPTION) {\n var newChunk = new Chunk(ChunkType.REPETITION);\n newChunk.setMinCount(0);\n newChunk.setMaxCount(multiplier);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = nextChunk.chunkList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var c = _step.value;\n\n newChunk.addChunk(c);\n }\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 this.chunkList.splice(i, 1);\n this.chunkList[i - 1] = newChunk;\n } else {\n var _newChunk = new Chunk(ChunkType.REPETITION);\n _newChunk.setMinCount(multiplier);\n _newChunk.setMaxCount(multiplier);\n _newChunk.addChunk(nextChunk);\n this.chunkList.splice(i, 1);\n this.chunkList[i - 1] = _newChunk;\n }\n } else {\n var _newChunk2 = new Chunk(ChunkType.REPETITION);\n _newChunk2.setMinCount(0);\n _newChunk2.addChunk(previousChunk);\n this.chunkList[i - 1] = _newChunk2;\n }\n } else if (\"+\" === chunk.text) {\n this.chunkList.splice(i, 1);\n var _newChunk3 = new Chunk(ChunkType.REPETITION);\n _newChunk3.setMinCount(1);\n var _previousChunk = this.chunkList[i - 1];\n _newChunk3.addChunk(_previousChunk);\n this.chunkList[i - 1] = _newChunk3;\n } else if (\"?\" === chunk.text) {\n this.chunkList.splice(i, 1);\n var _newChunk4 = new Chunk(ChunkType.OPTION);\n var _previousChunk2 = this.chunkList[i - 1];\n _newChunk4.addChunk(_previousChunk2);\n this.chunkList[i - 1] = _newChunk4;\n }\n break;\n }\n case ChunkType.COMMENT:\n {\n // For now, nothing to do\n this.chunkList.splice(i, 1);\n }\n case ChunkType.ALTERNATION:\n {\n hasAlternation = true;\n break;\n }\n case ChunkType.GROUP:\n {\n // Group could be empty\n if (chunk.chunkList != null) {\n chunk.prune();\n if (chunk.chunkList.length == 1) {\n this.chunkList[i] = chunk.chunkList[0];\n }\n }\n break;\n }\n case ChunkType.OPTION:\n case ChunkType.REPETITION:\n {\n chunk.prune();\n break;\n }\n }\n }\n if (hasAlternation) {\n var alternationSequenceList = [];\n alternationSequenceList.push([]);\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = this.chunkList[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _chunk = _step2.value;\n\n if (_chunk.getType() == ChunkType.ALTERNATION) {\n alternationSequenceList.push([]);\n } else {\n var list = alternationSequenceList[alternationSequenceList.length - 1];\n list.push(_chunk);\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var choiceChunk = new Chunk(ChunkType.CHOICE);\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = alternationSequenceList[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var subList = _step3.value;\n\n if (subList.length == 1) {\n choiceChunk.addChunk(subList[0]);\n } else {\n var groupChunk = new Chunk(ChunkType.GROUP);\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = subList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var _c = _step4.value;\n\n groupChunk.addChunk(_c);\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n\n choiceChunk.addChunk(groupChunk);\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n this.chunkList.length = 0;\n this.chunkList.push(choiceChunk);\n }\n }\n }, {\n key: 'getExpression',\n value: function getExpression() {\n switch (this.type) {\n case ChunkType.GROUP:\n {\n if (this.chunkList == null) {\n // Group is empty.\n return new _sequence2.default();\n }\n if (this.chunkList.length == 1) {\n return this.chunkList[0].getExpression();\n }\n var expressionList = [];\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = this.chunkList[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var chunk = _step5.value;\n\n expressionList.push(chunk.getExpression());\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n return new _sequence2.default(expressionList);\n }\n case ChunkType.CHOICE:\n {\n if (this.chunkList.length == 1) {\n return this.chunkList[0].getExpression();\n }\n var _expressionList = [];\n var hasLine = false;\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = this.chunkList[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var _chunk2 = _step6.value;\n\n var expression = _chunk2.getExpression();\n if (expression instanceof _repetition2.default) {\n var repetition = expression;\n if (repetition.getMinRepetitionCount() == 0) {\n if (repetition.getMaxRepetitionCount() == null || repetition.getMaxRepetitionCount() != 1) {\n expression = new _repetition2.default(repetition.getExpression(), 1, repetition.getMaxRepetitionCount());\n } else {\n expression = repetition.getExpression();\n }\n hasLine = true;\n }\n }\n if (expression instanceof _choice2.default) {\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = expression.getExpressions()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var exp = _step7.value;\n\n _expressionList.push(exp);\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n } else {\n _expressionList.push(expression);\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n\n if (hasLine && (_expressionList.length == 0 || !isNoop(_expressionList[_expressionList.length - 1]))) {\n _expressionList.push(new _sequence2.default());\n }\n return new _choice2.default(_expressionList);\n }\n case ChunkType.RULE:\n {\n return new _rulereference2.default(this.text);\n }\n case ChunkType.LITERAL:\n {\n return new _literal2.default(this.text);\n }\n case ChunkType.SPECIAL_SEQUENCE:\n {\n return new _specialsequence2.default(this.text);\n }\n case ChunkType.OPTION:\n {\n if (this.chunkList.length == 1) {\n var subChunk = this.chunkList[0];\n if (subChunk.getType() == ChunkType.CHOICE) {\n var newChunk = new Chunk(ChunkType.CHOICE);\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = subChunk.chunkList[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var cChunk = _step8.value;\n\n newChunk.addChunk(cChunk);\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n\n newChunk.addChunk(new Chunk(ChunkType.GROUP));\n return newChunk.getExpression();\n }\n return new _repetition2.default(subChunk.getExpression(), 0, 1);\n }\n var _expressionList2 = [];\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = this.chunkList[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var _chunk3 = _step9.value;\n\n _expressionList2.push(_chunk3.getExpression());\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n\n return new _repetition2.default(new _sequence2.default(_expressionList2), 0, 1);\n }\n case ChunkType.REPETITION:\n {\n if (this.chunkList.length == 1) {\n return new _repetition2.default(this.chunkList[0].getExpression(), this.minCount, this.maxCount);\n }\n var _expressionList3 = [];\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = this.chunkList[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var _chunk4 = _step10.value;\n\n _expressionList3.push(_chunk4.getExpression());\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n\n return new _repetition2.default(new _sequence2.default(_expressionList3), this.minCount, this.maxCount);\n }\n }\n throw \"Type should not be reachable: \" + this.type;\n }\n }, {\n key: 'toString',\n value: function toString() {\n var s = \"\" + this.type;\n if (this.text != null) {\n s += \" (\" + this.text + \")\";\n }\n return s;\n }\n }]);\n\n return Chunk;\n}();\n\nexports.default = Chunk;\n\n/***/ }),\n/* 157 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _utils = __webpack_require__(84);\n\nvar _svgline = __webpack_require__(158);\n\nvar _svgline2 = _interopRequireDefault(_svgline);\n\nvar _svgpath = __webpack_require__(159);\n\nvar _svgpath2 = _interopRequireDefault(_svgpath);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SvgContent = function () {\n function SvgContent() {\n _classCallCheck(this, SvgContent);\n\n this.connectorList = [];\n this.elements = [];\n }\n\n _createClass(SvgContent, [{\n key: 'addPathConnector',\n value: function addPathConnector(x1, y1, path, x2, y2) {\n var c = this.connectorList.length == 0 ? null : this.connectorList[this.connectorList.length - 1];\n if (c != null) {\n if (c instanceof _svgpath2.default) {\n c.addPath(new _svgpath2.default(x1, y1, path, x2, y2));\n } else {\n var svgLine = c;\n var x1_ = svgLine.getX1();\n var y1_ = svgLine.getY1();\n var x2_ = svgLine.getX2();\n var y2_ = svgLine.getY2();\n if (x1_ == x2_ && x1 == x1_) {\n if (y2_ == y1 - 1) {\n svgLine.mergeLine(x1_, y1_, x2_, y2_ + 1);\n } else if (y1_ == y1 + 1) {\n svgLine.mergeLine(x1_, y1_ - 1, x2_, y2_);\n }\n } else if (y1_ == y2_ && y1 == y1_) {\n if (x2_ == x1 - 1) {\n svgLine.mergeLine(x1_, y1_, x2_ + 1, y2_);\n } else if (x1_ == x1 + 1) {\n svgLine.mergeLine(x1_ - 1, y1_, x2_, y2_);\n }\n }\n this.connectorList.push(new _svgpath2.default(x1, y1, path, x2, y2));\n }\n } else {\n this.connectorList.push(new _svgpath2.default(x1, y1, path, x2, y2));\n }\n }\n }, {\n key: 'addLineConnector',\n value: function addLineConnector(x1, y1, x2, y2) {\n var x1_ = Math.min(x1, x2);\n var y1_ = Math.min(y1, y2);\n var x2_ = Math.max(x1, x2);\n var y2_ = Math.max(y1, y2);\n var c = this.connectorList.length == 0 ? null : this.connectorList[this.connectorList.length - 1];\n if (c == null || !(c instanceof _svgline2.default) || !c.mergeLine(x1_, y1_, x2_, y2_)) {\n this.connectorList.push(new _svgline2.default(x1_, y1_, x2_, y2_));\n }\n }\n }, {\n key: 'getConnectorElement',\n value: function getConnectorElement(rrDiagramToSVG) {\n if (this.connectorList.length == 0) {\n return \"\";\n }\n var path0 = null;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.connectorList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var connector = _step.value;\n\n if (path0 == null) {\n if (connector instanceof _svgpath2.default) {\n path0 = connector;\n } else {\n var svgLine = connector;\n var x1 = svgLine.getX1();\n var y1 = svgLine.getY1();\n path0 = new _svgpath2.default(x1, y1, \"M\" + x1 + (y1 < 0 ? y1 : \" \" + y1), x1, y1);\n path0.addLine(svgLine);\n }\n } else {\n if (connector instanceof _svgpath2.default) {\n path0.addPath(connector);\n } else {\n path0.addLine(connector);\n }\n }\n }\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 return \"<path class=\\\"\" + (0, _utils.escapeXml)(rrDiagramToSVG.cssConnectorClass) + \"\\\" d=\\\"\" + path0.getPath() + \"\\\"/>\";\n }\n }, {\n key: 'addElement',\n value: function addElement(element) {\n this.elements.push(element);\n }\n }, {\n key: 'getElements',\n value: function getElements() {\n return this.elements;\n }\n }]);\n\n return SvgContent;\n}();\n\nexports.default = SvgContent;\n\n/***/ }),\n/* 158 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar svgline = function () {\n function svgline(x1, y1, x2, y2) {\n _classCallCheck(this, svgline);\n\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }\n\n _createClass(svgline, [{\n key: \"getX1\",\n value: function getX1() {\n return this.x1;\n }\n }, {\n key: \"getY1\",\n value: function getY1() {\n return this.y1;\n }\n }, {\n key: \"getX2\",\n value: function getX2() {\n return this.x2;\n }\n }, {\n key: \"getY2\",\n value: function getY2() {\n return this.y2;\n }\n }, {\n key: \"mergeLine\",\n value: function mergeLine(x1, y1, x2, y2) {\n if (x1 == x2 && this.x1 == this.x2 && x1 == this.x1) {\n if (y2 >= this.y1 - 1 && y1 <= this.y2 + 1) {\n this.y1 = Math.min(this.y1, y1);\n this.y2 = Math.max(this.y2, y2);\n return true;\n }\n } else if (y1 == y2 && this.y1 == this.y2 && y1 == this.y1) {\n if (x2 >= this.x1 - 1 && x1 <= this.x2 + 1) {\n this.x1 = Math.min(this.x1, x1);\n this.x2 = Math.max(this.x2, x2);\n return true;\n }\n }\n return false;\n }\n }]);\n\n return svgline;\n}();\n\nexports.default = svgline;\n\n/***/ }),\n/* 159 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SvgPath = function () {\n function SvgPath(startX, startY, path, endX, endY) {\n _classCallCheck(this, SvgPath);\n\n this.pathSB = [];\n this.startX = startX;\n this.startY = startY;\n this.pathSB.push(path);\n this.endX = endX;\n this.endY = endY;\n }\n\n _createClass(SvgPath, [{\n key: \"addPath\",\n value: function addPath(svgPath) {\n var x1 = svgPath.startX;\n var y1 = svgPath.startY;\n var path = svgPath.getPath();\n var x2 = svgPath.endX;\n var y2 = svgPath.endY;\n if (x1 != this.endX || y1 != this.endY) {\n if (x1 == this.endX && y1 == this.endY + 1) {\n this.pathSB.push(\"v\", y1 - y2);\n } else if (y1 == this.endY && x1 == this.endX + 1) {\n this.pathSB.push(\"h\", x1 - x2);\n } else {\n this.pathSB.push(\"m\", x1 - this.endX);\n if (y1 - this.endY >= 0) {\n this.pathSB.push(\" \");\n }\n this.pathSB.push(y1 - this.endY);\n }\n }\n this.pathSB.push(path);\n this.endX = x2;\n this.endY = y2;\n }\n }, {\n key: \"addLine\",\n value: function addLine(svgLine) {\n var x1 = svgLine.getX1();\n var y1 = svgLine.getY1();\n var x2 = svgLine.getX2();\n var y2 = svgLine.getY2();\n if (x1 == x2 && this.endX == x1) {\n if (this.endY == y1 || this.endY == y1 - 1) {\n this.pathSB.push(\"v\", y2 - this.endY);\n this.endY = y2;\n return;\n }\n if (this.endY == y2 || this.endY == y2 + 1) {\n this.pathSB.push(\"v\", y1 - this.endY);\n this.endY = y1;\n return;\n }\n } else if (y1 == y2 && this.endY == y1) {\n if (this.endX == x1 || this.endX == x1 - 1) {\n this.pathSB.push(\"h\", x2 - this.endX);\n this.endX = x2;\n return;\n }\n if (this.endX == x2 || this.endX == x2 + 1) {\n this.pathSB.push(\"h\", x1 - this.endX);\n this.endX = x1;\n return;\n }\n }\n this.pathSB.push(\"m\", x1 - this.endX);\n if (y1 - this.endY >= 0) {\n this.pathSB.push(\" \");\n }\n this.pathSB.push(y1 - this.endY);\n if (x1 == x2) {\n this.pathSB.push(\"v\", y2 - y1);\n } else if (y1 == y2) {\n this.pathSB.push(\"h\", x2 - x1);\n } else {\n this.pathSB.push(\"l\", x2 - x1);\n if (y2 - y1 >= 0) {\n this.pathSB.push(\" \");\n }\n this.pathSB.push(y2 - y1);\n }\n this.endX = x2;\n this.endY = y2;\n }\n }, {\n key: \"getPath\",\n value: function getPath() {\n return this.pathSB.join(\"\");\n }\n }]);\n\n return SvgPath;\n}();\n\nexports.default = SvgPath;\n\n/***/ }),\n/* 160 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(167);\nmodule.exports = __webpack_require__(20).RegExp.escape;\n\n\n/***/ }),\n/* 161 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nvar isArray = __webpack_require__(64);\nvar SPECIES = __webpack_require__(5)('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n\n/***/ }),\n/* 162 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = __webpack_require__(3);\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n\n\n/***/ }),\n/* 163 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar anObject = __webpack_require__(1);\nvar toPrimitive = __webpack_require__(29);\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n\n\n/***/ }),\n/* 164 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(40);\nvar gOPS = __webpack_require__(68);\nvar pIE = __webpack_require__(55);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n\n\n/***/ }),\n/* 165 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(56)('native-function-to-string', Function.toString);\n\n\n/***/ }),\n/* 166 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n\n\n/***/ }),\n/* 167 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/benjamingr/RexExp.escape\nvar $export = __webpack_require__(0);\nvar $re = __webpack_require__(166)(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n\n\n/***/ }),\n/* 168 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { copyWithin: __webpack_require__(117) });\n\n__webpack_require__(33)('copyWithin');\n\n\n/***/ }),\n/* 169 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $every = __webpack_require__(26)(4);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 170 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { fill: __webpack_require__(86) });\n\n__webpack_require__(33)('fill');\n\n\n/***/ }),\n/* 171 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $filter = __webpack_require__(26)(2);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 172 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(26)(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(33)(KEY);\n\n\n/***/ }),\n/* 173 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(26)(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(33)(KEY);\n\n\n/***/ }),\n/* 174 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $forEach = __webpack_require__(26)(0);\nvar STRICT = __webpack_require__(22)([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 175 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar ctx = __webpack_require__(21);\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar call = __webpack_require__(128);\nvar isArrayIter = __webpack_require__(94);\nvar toLength = __webpack_require__(6);\nvar createProperty = __webpack_require__(88);\nvar getIterFn = __webpack_require__(110);\n\n$export($export.S + $export.F * !__webpack_require__(66)(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n/***/ }),\n/* 176 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $indexOf = __webpack_require__(61)(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(22)($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 177 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Array', { isArray: __webpack_require__(64) });\n\n\n/***/ }),\n/* 178 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(18);\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (__webpack_require__(54) != Object || !__webpack_require__(22)(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n\n\n/***/ }),\n/* 179 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(18);\nvar toInteger = __webpack_require__(23);\nvar toLength = __webpack_require__(6);\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(22)($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n\n\n/***/ }),\n/* 180 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $map = __webpack_require__(26)(1);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 181 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar createProperty = __webpack_require__(88);\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * __webpack_require__(3)(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n\n/***/ }),\n/* 182 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(119);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n\n\n/***/ }),\n/* 183 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(119);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n\n\n/***/ }),\n/* 184 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar html = __webpack_require__(92);\nvar cof = __webpack_require__(19);\nvar toAbsoluteIndex = __webpack_require__(44);\nvar toLength = __webpack_require__(6);\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * __webpack_require__(3)(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n\n\n/***/ }),\n/* 185 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $some = __webpack_require__(26)(3);\n\n$export($export.P + $export.F * !__webpack_require__(22)([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n\n\n/***/ }),\n/* 186 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(10);\nvar toObject = __webpack_require__(9);\nvar fails = __webpack_require__(3);\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !__webpack_require__(22)($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n\n\n/***/ }),\n/* 187 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(43)('Array');\n\n\n/***/ }),\n/* 188 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n\n\n/***/ }),\n/* 189 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = __webpack_require__(0);\nvar toISOString = __webpack_require__(162);\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n\n\n/***/ }),\n/* 190 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar toPrimitive = __webpack_require__(29);\n\n$export($export.P + $export.F * __webpack_require__(3)(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n\n\n/***/ }),\n/* 191 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar TO_PRIMITIVE = __webpack_require__(5)('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) __webpack_require__(12)(proto, TO_PRIMITIVE, __webpack_require__(163));\n\n\n/***/ }),\n/* 192 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n __webpack_require__(13)(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n\n\n/***/ }),\n/* 193 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Function', { bind: __webpack_require__(120) });\n\n\n/***/ }),\n/* 194 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar isObject = __webpack_require__(4);\nvar getPrototypeOf = __webpack_require__(17);\nvar HAS_INSTANCE = __webpack_require__(5)('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(8).f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n\n\n/***/ }),\n/* 195 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(8).f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(7) && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n\n\n/***/ }),\n/* 196 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.3 Math.acosh(x)\nvar $export = __webpack_require__(0);\nvar log1p = __webpack_require__(131);\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n\n\n/***/ }),\n/* 197 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.5 Math.asinh(x)\nvar $export = __webpack_require__(0);\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n\n\n/***/ }),\n/* 198 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.7 Math.atanh(x)\nvar $export = __webpack_require__(0);\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n\n\n/***/ }),\n/* 199 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.9 Math.cbrt(x)\nvar $export = __webpack_require__(0);\nvar sign = __webpack_require__(98);\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n\n\n/***/ }),\n/* 200 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.11 Math.clz32(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n\n\n/***/ }),\n/* 201 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.12 Math.cosh(x)\nvar $export = __webpack_require__(0);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n\n\n/***/ }),\n/* 202 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.14 Math.expm1(x)\nvar $export = __webpack_require__(0);\nvar $expm1 = __webpack_require__(97);\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n\n\n/***/ }),\n/* 203 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.16 Math.fround(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { fround: __webpack_require__(130) });\n\n\n/***/ }),\n/* 204 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = __webpack_require__(0);\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n\n\n/***/ }),\n/* 205 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.18 Math.imul(x, y)\nvar $export = __webpack_require__(0);\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * __webpack_require__(3)(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n\n\n/***/ }),\n/* 206 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.21 Math.log10(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n\n\n/***/ }),\n/* 207 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.20 Math.log1p(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { log1p: __webpack_require__(131) });\n\n\n/***/ }),\n/* 208 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.22 Math.log2(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n\n\n/***/ }),\n/* 209 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.28 Math.sign(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { sign: __webpack_require__(98) });\n\n\n/***/ }),\n/* 210 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.30 Math.sinh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(97);\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * __webpack_require__(3)(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n\n\n/***/ }),\n/* 211 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.33 Math.tanh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(97);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n\n\n/***/ }),\n/* 212 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.2.2.34 Math.trunc(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n\n\n/***/ }),\n/* 213 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(2);\nvar has = __webpack_require__(15);\nvar cof = __webpack_require__(19);\nvar inheritIfRequired = __webpack_require__(93);\nvar toPrimitive = __webpack_require__(29);\nvar fails = __webpack_require__(3);\nvar gOPN = __webpack_require__(39).f;\nvar gOPD = __webpack_require__(16).f;\nvar dP = __webpack_require__(8).f;\nvar $trim = __webpack_require__(50).trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(__webpack_require__(38)(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = __webpack_require__(7) ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n __webpack_require__(13)(global, NUMBER, $Number);\n}\n\n\n/***/ }),\n/* 214 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.1 Number.EPSILON\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n\n\n/***/ }),\n/* 215 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.2 Number.isFinite(number)\nvar $export = __webpack_require__(0);\nvar _isFinite = __webpack_require__(2).isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n\n\n/***/ }),\n/* 216 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { isInteger: __webpack_require__(127) });\n\n\n/***/ }),\n/* 217 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.4 Number.isNaN(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n\n\n/***/ }),\n/* 218 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = __webpack_require__(0);\nvar isInteger = __webpack_require__(127);\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n\n\n/***/ }),\n/* 219 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n\n\n/***/ }),\n/* 220 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n\n\n/***/ }),\n/* 221 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(139);\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n\n\n/***/ }),\n/* 222 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(140);\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n\n\n/***/ }),\n/* 223 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toInteger = __webpack_require__(23);\nvar aNumberValue = __webpack_require__(116);\nvar repeat = __webpack_require__(105);\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !__webpack_require__(3)(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n\n\n/***/ }),\n/* 224 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $fails = __webpack_require__(3);\nvar aNumberValue = __webpack_require__(116);\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n\n\n/***/ }),\n/* 225 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(0);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(133) });\n\n\n/***/ }),\n/* 226 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(38) });\n\n\n/***/ }),\n/* 227 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperties: __webpack_require__(134) });\n\n\n/***/ }),\n/* 228 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(8).f });\n\n\n/***/ }),\n/* 229 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.5 Object.freeze(O)\nvar isObject = __webpack_require__(4);\nvar meta = __webpack_require__(35).onFreeze;\n\n__webpack_require__(28)('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n\n\n/***/ }),\n/* 230 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(18);\nvar $getOwnPropertyDescriptor = __webpack_require__(16).f;\n\n__webpack_require__(28)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n\n\n/***/ }),\n/* 231 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.7 Object.getOwnPropertyNames(O)\n__webpack_require__(28)('getOwnPropertyNames', function () {\n return __webpack_require__(135).f;\n});\n\n\n/***/ }),\n/* 232 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(9);\nvar $getPrototypeOf = __webpack_require__(17);\n\n__webpack_require__(28)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n\n\n/***/ }),\n/* 233 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.11 Object.isExtensible(O)\nvar isObject = __webpack_require__(4);\n\n__webpack_require__(28)('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n\n\n/***/ }),\n/* 234 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.12 Object.isFrozen(O)\nvar isObject = __webpack_require__(4);\n\n__webpack_require__(28)('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n\n\n/***/ }),\n/* 235 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.13 Object.isSealed(O)\nvar isObject = __webpack_require__(4);\n\n__webpack_require__(28)('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n\n\n/***/ }),\n/* 236 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.10 Object.is(value1, value2)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { is: __webpack_require__(143) });\n\n\n/***/ }),\n/* 237 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(9);\nvar $keys = __webpack_require__(40);\n\n__webpack_require__(28)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n\n\n/***/ }),\n/* 238 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = __webpack_require__(4);\nvar meta = __webpack_require__(35).onFreeze;\n\n__webpack_require__(28)('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n\n\n/***/ }),\n/* 239 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.17 Object.seal(O)\nvar isObject = __webpack_require__(4);\nvar meta = __webpack_require__(35).onFreeze;\n\n__webpack_require__(28)('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n\n\n/***/ }),\n/* 240 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(102).set });\n\n\n/***/ }),\n/* 241 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.3.6 Object.prototype.toString()\nvar classof = __webpack_require__(47);\nvar test = {};\ntest[__webpack_require__(5)('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n __webpack_require__(13)(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n\n\n/***/ }),\n/* 242 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(139);\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n\n\n/***/ }),\n/* 243 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(140);\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n\n\n/***/ }),\n/* 244 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(34);\nvar global = __webpack_require__(2);\nvar ctx = __webpack_require__(21);\nvar classof = __webpack_require__(47);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(4);\nvar aFunction = __webpack_require__(10);\nvar anInstance = __webpack_require__(36);\nvar forOf = __webpack_require__(37);\nvar speciesConstructor = __webpack_require__(57);\nvar task = __webpack_require__(107).set;\nvar microtask = __webpack_require__(99)();\nvar newPromiseCapabilityModule = __webpack_require__(100);\nvar perform = __webpack_require__(141);\nvar userAgent = __webpack_require__(74);\nvar promiseResolve = __webpack_require__(142);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(42)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(49)($Promise, PROMISE);\n__webpack_require__(43)(PROMISE);\nWrapper = __webpack_require__(20)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(66)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n\n\n/***/ }),\n/* 245 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(10);\nvar anObject = __webpack_require__(1);\nvar rApply = (__webpack_require__(2).Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !__webpack_require__(3)(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n\n\n/***/ }),\n/* 246 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = __webpack_require__(0);\nvar create = __webpack_require__(38);\nvar aFunction = __webpack_require__(10);\nvar anObject = __webpack_require__(1);\nvar isObject = __webpack_require__(4);\nvar fails = __webpack_require__(3);\nvar bind = __webpack_require__(120);\nvar rConstruct = (__webpack_require__(2).Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n\n\n/***/ }),\n/* 247 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = __webpack_require__(8);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(1);\nvar toPrimitive = __webpack_require__(29);\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * __webpack_require__(3)(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n\n/***/ }),\n/* 248 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = __webpack_require__(0);\nvar gOPD = __webpack_require__(16).f;\nvar anObject = __webpack_require__(1);\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n\n\n/***/ }),\n/* 249 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 26.1.5 Reflect.enumerate(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(1);\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\n__webpack_require__(95)(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n\n\n/***/ }),\n/* 250 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = __webpack_require__(16);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(1);\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n\n\n/***/ }),\n/* 251 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = __webpack_require__(0);\nvar getProto = __webpack_require__(17);\nvar anObject = __webpack_require__(1);\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n\n\n/***/ }),\n/* 252 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = __webpack_require__(16);\nvar getPrototypeOf = __webpack_require__(17);\nvar has = __webpack_require__(15);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(4);\nvar anObject = __webpack_require__(1);\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n\n\n/***/ }),\n/* 253 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n\n\n/***/ }),\n/* 254 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.10 Reflect.isExtensible(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(1);\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n\n\n/***/ }),\n/* 255 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.11 Reflect.ownKeys(target)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', { ownKeys: __webpack_require__(138) });\n\n\n/***/ }),\n/* 256 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.12 Reflect.preventExtensions(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(1);\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n\n/***/ }),\n/* 257 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = __webpack_require__(0);\nvar setProto = __webpack_require__(102);\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n\n/***/ }),\n/* 258 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = __webpack_require__(8);\nvar gOPD = __webpack_require__(16);\nvar getPrototypeOf = __webpack_require__(17);\nvar has = __webpack_require__(15);\nvar $export = __webpack_require__(0);\nvar createDesc = __webpack_require__(41);\nvar anObject = __webpack_require__(1);\nvar isObject = __webpack_require__(4);\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n\n\n/***/ }),\n/* 259 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(2);\nvar inheritIfRequired = __webpack_require__(93);\nvar dP = __webpack_require__(8).f;\nvar gOPN = __webpack_require__(39).f;\nvar isRegExp = __webpack_require__(65);\nvar $flags = __webpack_require__(53);\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (__webpack_require__(7) && (!CORRECT_NEW || __webpack_require__(3)(function () {\n re2[__webpack_require__(5)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n __webpack_require__(13)(global, 'RegExp', $RegExp);\n}\n\n__webpack_require__(43)('RegExp');\n\n\n/***/ }),\n/* 260 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar anObject = __webpack_require__(1);\nvar toLength = __webpack_require__(6);\nvar advanceStringIndex = __webpack_require__(85);\nvar regExpExec = __webpack_require__(69);\n\n// @@match logic\n__webpack_require__(63)('match', 1, function (defined, MATCH, $match, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match\n function (regexp) {\n var res = maybeCallNative($match, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n if (!rx.global) return regExpExec(rx, S);\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = String(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n\n\n/***/ }),\n/* 261 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar anObject = __webpack_require__(1);\nvar toObject = __webpack_require__(9);\nvar toLength = __webpack_require__(6);\nvar toInteger = __webpack_require__(23);\nvar advanceStringIndex = __webpack_require__(85);\nvar regExpExec = __webpack_require__(69);\nvar max = Math.max;\nvar min = Math.min;\nvar floor = Math.floor;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&`']|\\d\\d?|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&`']|\\d\\d?)/g;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// @@replace logic\n__webpack_require__(63)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {\n return [\n // `String.prototype.replace` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace\n function (regexp, replaceValue) {\n var res = maybeCallNative($replace, regexp, this, replaceValue);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = String(replaceValue);\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n results.push(result);\n if (!global) break;\n var matchStr = String(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n var matched = String(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = String(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n\n // https://tc39.github.io/ecma262/#sec-getsubstitution\n function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return $replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n }\n});\n\n\n/***/ }),\n/* 262 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar anObject = __webpack_require__(1);\nvar sameValue = __webpack_require__(143);\nvar regExpExec = __webpack_require__(69);\n\n// @@search logic\n__webpack_require__(63)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative($search, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n\n\n/***/ }),\n/* 263 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar isRegExp = __webpack_require__(65);\nvar anObject = __webpack_require__(1);\nvar speciesConstructor = __webpack_require__(57);\nvar advanceStringIndex = __webpack_require__(85);\nvar toLength = __webpack_require__(6);\nvar callRegExpExec = __webpack_require__(69);\nvar regexpExec = __webpack_require__(101);\nvar fails = __webpack_require__(3);\nvar $min = Math.min;\nvar $push = [].push;\nvar $SPLIT = 'split';\nvar LENGTH = 'length';\nvar LAST_INDEX = 'lastIndex';\nvar MAX_UINT32 = 0xffffffff;\n\n// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError\nvar SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });\n\n// @@split logic\n__webpack_require__(63)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return $split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy[LAST_INDEX];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);\n };\n } else {\n internalSplit = $split;\n }\n\n return [\n // `String.prototype.split` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = defined(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(String(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (regexp, limit) {\n var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (SUPPORTS_Y ? 'y' : 'g');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = SUPPORTS_Y ? q : 0;\n var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));\n var e;\n if (\n z === null ||\n (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n});\n\n\n/***/ }),\n/* 264 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n__webpack_require__(149);\nvar anObject = __webpack_require__(1);\nvar $flags = __webpack_require__(53);\nvar DESCRIPTORS = __webpack_require__(7);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(13)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(3)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n\n\n/***/ }),\n/* 265 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.2 String.prototype.anchor(name)\n__webpack_require__(14)('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n\n\n/***/ }),\n/* 266 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.3 String.prototype.big()\n__webpack_require__(14)('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n\n\n/***/ }),\n/* 267 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.4 String.prototype.blink()\n__webpack_require__(14)('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n\n\n/***/ }),\n/* 268 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.5 String.prototype.bold()\n__webpack_require__(14)('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n\n\n/***/ }),\n/* 269 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(72)(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n\n\n/***/ }),\n/* 270 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(6);\nvar context = __webpack_require__(104);\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(91)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n\n\n/***/ }),\n/* 271 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.6 String.prototype.fixed()\n__webpack_require__(14)('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n\n\n/***/ }),\n/* 272 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.7 String.prototype.fontcolor(color)\n__webpack_require__(14)('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n\n\n/***/ }),\n/* 273 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.8 String.prototype.fontsize(size)\n__webpack_require__(14)('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n\n\n/***/ }),\n/* 274 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar toAbsoluteIndex = __webpack_require__(44);\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n\n\n/***/ }),\n/* 275 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n\nvar $export = __webpack_require__(0);\nvar context = __webpack_require__(104);\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * __webpack_require__(91)(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n\n/***/ }),\n/* 276 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.9 String.prototype.italics()\n__webpack_require__(14)('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n\n\n/***/ }),\n/* 277 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $at = __webpack_require__(72)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(96)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n\n\n/***/ }),\n/* 278 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.10 String.prototype.link(url)\n__webpack_require__(14)('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n\n\n/***/ }),\n/* 279 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(18);\nvar toLength = __webpack_require__(6);\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n\n\n/***/ }),\n/* 280 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: __webpack_require__(105)\n});\n\n\n/***/ }),\n/* 281 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.11 String.prototype.small()\n__webpack_require__(14)('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n\n\n/***/ }),\n/* 282 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(6);\nvar context = __webpack_require__(104);\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(91)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\n\n/***/ }),\n/* 283 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.12 String.prototype.strike()\n__webpack_require__(14)('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n\n\n/***/ }),\n/* 284 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.13 String.prototype.sub()\n__webpack_require__(14)('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n\n\n/***/ }),\n/* 285 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// B.2.3.14 String.prototype.sup()\n__webpack_require__(14)('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n\n\n/***/ }),\n/* 286 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 21.1.3.25 String.prototype.trim()\n__webpack_require__(50)('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n\n\n/***/ }),\n/* 287 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(2);\nvar has = __webpack_require__(15);\nvar DESCRIPTORS = __webpack_require__(7);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(13);\nvar META = __webpack_require__(35).KEY;\nvar $fails = __webpack_require__(3);\nvar shared = __webpack_require__(56);\nvar setToStringTag = __webpack_require__(49);\nvar uid = __webpack_require__(45);\nvar wks = __webpack_require__(5);\nvar wksExt = __webpack_require__(146);\nvar wksDefine = __webpack_require__(109);\nvar enumKeys = __webpack_require__(164);\nvar isArray = __webpack_require__(64);\nvar anObject = __webpack_require__(1);\nvar isObject = __webpack_require__(4);\nvar toObject = __webpack_require__(9);\nvar toIObject = __webpack_require__(18);\nvar toPrimitive = __webpack_require__(29);\nvar createDesc = __webpack_require__(41);\nvar _create = __webpack_require__(38);\nvar gOPNExt = __webpack_require__(135);\nvar $GOPD = __webpack_require__(16);\nvar $GOPS = __webpack_require__(68);\nvar $DP = __webpack_require__(8);\nvar $keys = __webpack_require__(40);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(39).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(55).f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(34)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(12)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n\n/***/ }),\n/* 288 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar $typed = __webpack_require__(73);\nvar buffer = __webpack_require__(108);\nvar anObject = __webpack_require__(1);\nvar toAbsoluteIndex = __webpack_require__(44);\nvar toLength = __webpack_require__(6);\nvar isObject = __webpack_require__(4);\nvar ArrayBuffer = __webpack_require__(2).ArrayBuffer;\nvar speciesConstructor = __webpack_require__(57);\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * __webpack_require__(3)(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\n__webpack_require__(43)(ARRAY_BUFFER);\n\n\n/***/ }),\n/* 289 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\n$export($export.G + $export.W + $export.F * !__webpack_require__(73).ABV, {\n DataView: __webpack_require__(108).DataView\n});\n\n\n/***/ }),\n/* 290 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 291 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 292 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 293 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 294 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 295 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 296 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 297 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n\n/***/ }),\n/* 298 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(31)('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n\n\n/***/ }),\n/* 299 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar weak = __webpack_require__(123);\nvar validate = __webpack_require__(46);\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\n__webpack_require__(62)(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n\n\n/***/ }),\n/* 300 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(124);\nvar toObject = __webpack_require__(9);\nvar toLength = __webpack_require__(6);\nvar aFunction = __webpack_require__(10);\nvar arraySpeciesCreate = __webpack_require__(87);\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\n__webpack_require__(33)('flatMap');\n\n\n/***/ }),\n/* 301 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(124);\nvar toObject = __webpack_require__(9);\nvar toLength = __webpack_require__(6);\nvar toInteger = __webpack_require__(23);\nvar arraySpeciesCreate = __webpack_require__(87);\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\n__webpack_require__(33)('flatten');\n\n\n/***/ }),\n/* 302 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/Array.prototype.includes\nvar $export = __webpack_require__(0);\nvar $includes = __webpack_require__(61)(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n__webpack_require__(33)('includes');\n\n\n/***/ }),\n/* 303 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = __webpack_require__(0);\nvar microtask = __webpack_require__(99)();\nvar process = __webpack_require__(2).process;\nvar isNode = __webpack_require__(19)(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n\n\n/***/ }),\n/* 304 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/ljharb/proposal-is-error\nvar $export = __webpack_require__(0);\nvar cof = __webpack_require__(19);\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n\n\n/***/ }),\n/* 305 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.G, { global: __webpack_require__(2) });\n\n\n/***/ }),\n/* 306 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n__webpack_require__(70)('Map');\n\n\n/***/ }),\n/* 307 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n__webpack_require__(71)('Map');\n\n\n/***/ }),\n/* 308 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(122)('Map') });\n\n\n/***/ }),\n/* 309 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n\n\n/***/ }),\n/* 310 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n\n\n/***/ }),\n/* 311 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n\n\n/***/ }),\n/* 312 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar scale = __webpack_require__(132);\nvar fround = __webpack_require__(130);\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n\n\n/***/ }),\n/* 313 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n\n\n/***/ }),\n/* 314 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);\n }\n});\n\n\n/***/ }),\n/* 315 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n\n\n/***/ }),\n/* 316 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n\n\n/***/ }),\n/* 317 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n\n\n/***/ }),\n/* 318 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { scale: __webpack_require__(132) });\n\n\n/***/ }),\n/* 319 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n\n\n/***/ }),\n/* 320 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n\n\n/***/ }),\n/* 321 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(10);\nvar $defineProperty = __webpack_require__(8);\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\n__webpack_require__(7) && $export($export.P + __webpack_require__(67), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n\n\n/***/ }),\n/* 322 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(10);\nvar $defineProperty = __webpack_require__(8);\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\n__webpack_require__(7) && $export($export.P + __webpack_require__(67), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n\n\n/***/ }),\n/* 323 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $entries = __webpack_require__(137)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n\n\n/***/ }),\n/* 324 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = __webpack_require__(0);\nvar ownKeys = __webpack_require__(138);\nvar toIObject = __webpack_require__(18);\nvar gOPD = __webpack_require__(16);\nvar createProperty = __webpack_require__(88);\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n\n\n/***/ }),\n/* 325 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar toPrimitive = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(17);\nvar getOwnPropertyDescriptor = __webpack_require__(16).f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\n__webpack_require__(7) && $export($export.P + __webpack_require__(67), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n\n\n/***/ }),\n/* 326 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(9);\nvar toPrimitive = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(17);\nvar getOwnPropertyDescriptor = __webpack_require__(16).f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\n__webpack_require__(7) && $export($export.P + __webpack_require__(67), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n\n\n/***/ }),\n/* 327 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $values = __webpack_require__(137)(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n\n\n/***/ }),\n/* 328 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/zenparsing/es-observable\nvar $export = __webpack_require__(0);\nvar global = __webpack_require__(2);\nvar core = __webpack_require__(20);\nvar microtask = __webpack_require__(99)();\nvar OBSERVABLE = __webpack_require__(5)('observable');\nvar aFunction = __webpack_require__(10);\nvar anObject = __webpack_require__(1);\nvar anInstance = __webpack_require__(36);\nvar redefineAll = __webpack_require__(42);\nvar hide = __webpack_require__(12);\nvar forOf = __webpack_require__(37);\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\n__webpack_require__(43)('Observable');\n\n\n/***/ }),\n/* 329 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(20);\nvar global = __webpack_require__(2);\nvar speciesConstructor = __webpack_require__(57);\nvar promiseResolve = __webpack_require__(142);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n\n\n/***/ }),\n/* 330 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(0);\nvar newPromiseCapability = __webpack_require__(100);\nvar perform = __webpack_require__(141);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n\n\n/***/ }),\n/* 331 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n\n\n/***/ }),\n/* 332 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n\n\n/***/ }),\n/* 333 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Set = __webpack_require__(150);\nvar from = __webpack_require__(118);\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar getPrototypeOf = __webpack_require__(17);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n\n\n/***/ }),\n/* 334 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar getPrototypeOf = __webpack_require__(17);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n\n/***/ }),\n/* 335 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n\n\n/***/ }),\n/* 336 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n\n/***/ }),\n/* 337 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar getPrototypeOf = __webpack_require__(17);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n\n/***/ }),\n/* 338 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n\n/***/ }),\n/* 339 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $metadata = __webpack_require__(30);\nvar anObject = __webpack_require__(1);\nvar aFunction = __webpack_require__(10);\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n\n\n/***/ }),\n/* 340 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\n__webpack_require__(70)('Set');\n\n\n/***/ }),\n/* 341 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\n__webpack_require__(71)('Set');\n\n\n/***/ }),\n/* 342 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(122)('Set') });\n\n\n/***/ }),\n/* 343 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(72)(true);\nvar $fails = __webpack_require__(3);\n\nvar FORCED = $fails(function () {\n return '𠮷'.at(0) !== '𠮷';\n});\n\n$export($export.P + $export.F * FORCED, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n\n\n/***/ }),\n/* 344 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = __webpack_require__(0);\nvar defined = __webpack_require__(27);\nvar toLength = __webpack_require__(6);\nvar isRegExp = __webpack_require__(65);\nvar getFlags = __webpack_require__(53);\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\n__webpack_require__(95)($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n\n\n/***/ }),\n/* 345 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(144);\nvar userAgent = __webpack_require__(74);\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n\n\n/***/ }),\n/* 346 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(144);\nvar userAgent = __webpack_require__(74);\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n\n\n/***/ }),\n/* 347 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(50)('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n\n\n/***/ }),\n/* 348 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(50)('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n\n\n/***/ }),\n/* 349 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(109)('asyncIterator');\n\n\n/***/ }),\n/* 350 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(109)('observable');\n\n\n/***/ }),\n/* 351 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'System', { global: __webpack_require__(2) });\n\n\n/***/ }),\n/* 352 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\n__webpack_require__(70)('WeakMap');\n\n\n/***/ }),\n/* 353 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\n__webpack_require__(71)('WeakMap');\n\n\n/***/ }),\n/* 354 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\n__webpack_require__(70)('WeakSet');\n\n\n/***/ }),\n/* 355 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\n__webpack_require__(71)('WeakSet');\n\n\n/***/ }),\n/* 356 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $iterators = __webpack_require__(111);\nvar getKeys = __webpack_require__(40);\nvar redefine = __webpack_require__(13);\nvar global = __webpack_require__(2);\nvar hide = __webpack_require__(12);\nvar Iterators = __webpack_require__(48);\nvar wks = __webpack_require__(5);\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n\n\n/***/ }),\n/* 357 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(0);\nvar $task = __webpack_require__(107);\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n\n\n/***/ }),\n/* 358 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// ie9- setTimeout & setInterval additional parameters fix\nvar global = __webpack_require__(2);\nvar $export = __webpack_require__(0);\nvar userAgent = __webpack_require__(74);\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n\n\n/***/ }),\n/* 359 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(287);\n__webpack_require__(226);\n__webpack_require__(228);\n__webpack_require__(227);\n__webpack_require__(230);\n__webpack_require__(232);\n__webpack_require__(237);\n__webpack_require__(231);\n__webpack_require__(229);\n__webpack_require__(239);\n__webpack_require__(238);\n__webpack_require__(234);\n__webpack_require__(235);\n__webpack_require__(233);\n__webpack_require__(225);\n__webpack_require__(236);\n__webpack_require__(240);\n__webpack_require__(241);\n__webpack_require__(193);\n__webpack_require__(195);\n__webpack_require__(194);\n__webpack_require__(243);\n__webpack_require__(242);\n__webpack_require__(213);\n__webpack_require__(223);\n__webpack_require__(224);\n__webpack_require__(214);\n__webpack_require__(215);\n__webpack_require__(216);\n__webpack_require__(217);\n__webpack_require__(218);\n__webpack_require__(219);\n__webpack_require__(220);\n__webpack_require__(221);\n__webpack_require__(222);\n__webpack_require__(196);\n__webpack_require__(197);\n__webpack_require__(198);\n__webpack_require__(199);\n__webpack_require__(200);\n__webpack_require__(201);\n__webpack_require__(202);\n__webpack_require__(203);\n__webpack_require__(204);\n__webpack_require__(205);\n__webpack_require__(206);\n__webpack_require__(207);\n__webpack_require__(208);\n__webpack_require__(209);\n__webpack_require__(210);\n__webpack_require__(211);\n__webpack_require__(212);\n__webpack_require__(274);\n__webpack_require__(279);\n__webpack_require__(286);\n__webpack_require__(277);\n__webpack_require__(269);\n__webpack_require__(270);\n__webpack_require__(275);\n__webpack_require__(280);\n__webpack_require__(282);\n__webpack_require__(265);\n__webpack_require__(266);\n__webpack_require__(267);\n__webpack_require__(268);\n__webpack_require__(271);\n__webpack_require__(272);\n__webpack_require__(273);\n__webpack_require__(276);\n__webpack_require__(278);\n__webpack_require__(281);\n__webpack_require__(283);\n__webpack_require__(284);\n__webpack_require__(285);\n__webpack_require__(188);\n__webpack_require__(190);\n__webpack_require__(189);\n__webpack_require__(192);\n__webpack_require__(191);\n__webpack_require__(177);\n__webpack_require__(175);\n__webpack_require__(181);\n__webpack_require__(178);\n__webpack_require__(184);\n__webpack_require__(186);\n__webpack_require__(174);\n__webpack_require__(180);\n__webpack_require__(171);\n__webpack_require__(185);\n__webpack_require__(169);\n__webpack_require__(183);\n__webpack_require__(182);\n__webpack_require__(176);\n__webpack_require__(179);\n__webpack_require__(168);\n__webpack_require__(170);\n__webpack_require__(173);\n__webpack_require__(172);\n__webpack_require__(187);\n__webpack_require__(111);\n__webpack_require__(259);\n__webpack_require__(148);\n__webpack_require__(264);\n__webpack_require__(149);\n__webpack_require__(260);\n__webpack_require__(261);\n__webpack_require__(262);\n__webpack_require__(263);\n__webpack_require__(244);\n__webpack_require__(147);\n__webpack_require__(150);\n__webpack_require__(151);\n__webpack_require__(299);\n__webpack_require__(288);\n__webpack_require__(289);\n__webpack_require__(294);\n__webpack_require__(297);\n__webpack_require__(298);\n__webpack_require__(292);\n__webpack_require__(295);\n__webpack_require__(293);\n__webpack_require__(296);\n__webpack_require__(290);\n__webpack_require__(291);\n__webpack_require__(245);\n__webpack_require__(246);\n__webpack_require__(247);\n__webpack_require__(248);\n__webpack_require__(249);\n__webpack_require__(252);\n__webpack_require__(250);\n__webpack_require__(251);\n__webpack_require__(253);\n__webpack_require__(254);\n__webpack_require__(255);\n__webpack_require__(256);\n__webpack_require__(258);\n__webpack_require__(257);\n__webpack_require__(302);\n__webpack_require__(300);\n__webpack_require__(301);\n__webpack_require__(343);\n__webpack_require__(346);\n__webpack_require__(345);\n__webpack_require__(347);\n__webpack_require__(348);\n__webpack_require__(344);\n__webpack_require__(349);\n__webpack_require__(350);\n__webpack_require__(324);\n__webpack_require__(327);\n__webpack_require__(323);\n__webpack_require__(321);\n__webpack_require__(322);\n__webpack_require__(325);\n__webpack_require__(326);\n__webpack_require__(308);\n__webpack_require__(342);\n__webpack_require__(307);\n__webpack_require__(341);\n__webpack_require__(353);\n__webpack_require__(355);\n__webpack_require__(306);\n__webpack_require__(340);\n__webpack_require__(352);\n__webpack_require__(354);\n__webpack_require__(305);\n__webpack_require__(351);\n__webpack_require__(304);\n__webpack_require__(309);\n__webpack_require__(310);\n__webpack_require__(311);\n__webpack_require__(312);\n__webpack_require__(313);\n__webpack_require__(315);\n__webpack_require__(314);\n__webpack_require__(316);\n__webpack_require__(317);\n__webpack_require__(318);\n__webpack_require__(320);\n__webpack_require__(319);\n__webpack_require__(329);\n__webpack_require__(330);\n__webpack_require__(331);\n__webpack_require__(332);\n__webpack_require__(334);\n__webpack_require__(333);\n__webpack_require__(336);\n__webpack_require__(335);\n__webpack_require__(337);\n__webpack_require__(338);\n__webpack_require__(339);\n__webpack_require__(303);\n__webpack_require__(328);\n__webpack_require__(358);\n__webpack_require__(357);\n__webpack_require__(356);\nmodule.exports = __webpack_require__(20);\n\n\n/***/ }),\n/* 360 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === \"object\" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(152)))\n\n/***/ }),\n/* 361 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(154);\nmodule.exports = __webpack_require__(153);\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// rrdiagram.js","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_export.js\n// module id = 0\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_an-object.js\n// module id = 1\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_global.js\n// module id = 2\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_fails.js\n// module id = 3\n// module chunks = 0","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_is-object.js\n// module id = 4\n// module chunks = 0","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_wks.js\n// module id = 5\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-length.js\n// module id = 6\n// module chunks = 0","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_descriptors.js\n// module id = 7\n// module chunks = 0","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-dp.js\n// module id = 8\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-object.js\n// module id = 9\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_a-function.js\n// module id = 10\n// module chunks = 0","export default class RRElement {\r\n\r\n constructor() {\r\n this.layoutInfo = null;\r\n }\r\n\r\n setLayoutInfo(layoutInfo) {\r\n this.layoutInfo = layoutInfo;\r\n }\r\n\r\n getLayoutInfo() {\r\n return this.layoutInfo;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/rrelement.js","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_hide.js\n// module id = 12\n// module chunks = 0","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar $toString = require('./_function-to-string');\nvar TO_STRING = 'toString';\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_redefine.js\n// module id = 13\n// module chunks = 0","var $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '&quot;') + '\"';\n return p1 + '>' + S + '</' + tag + '>';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-html.js\n// module id = 14\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_has.js\n// module id = 15\n// module chunks = 0","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-gopd.js\n// module id = 16\n// module chunks = 0","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-gpo.js\n// module id = 17\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-iobject.js\n// module id = 18\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_cof.js\n// module id = 19\n// module chunks = 0","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_core.js\n// module id = 20\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_ctx.js\n// module id = 21\n// module chunks = 0","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_strict-method.js\n// module id = 22\n// module chunks = 0","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-integer.js\n// module id = 23\n// module chunks = 0","import Grammar from './grammar';\r\n\r\nconst RuleDefinitionSign = {\r\n EQUAL: 1,\r\n COLON_EQUAL: 2,\r\n COLON_COLON_EQUAL: 3,\r\n};\r\n\r\nconst LiteralDefinitionSign = {\r\n QUOTE: 1,\r\n DOUBLE_QUOTE: 2,\r\n};\r\n\r\nexport default class GrammarToBNF {\r\n\r\n static get RuleDefinitionSign() {\r\n return RuleDefinitionSign;\r\n }\r\n\r\n static get LiteralDefinitionSign() {\r\n return LiteralDefinitionSign;\r\n }\r\n\r\n constructor() {\r\n this.ruleDefinitionSign = RuleDefinitionSign.EQUAL;\r\n this.literalDefinitionSign = LiteralDefinitionSign.QUOTE;\r\n this.isCommaSeparator = false;\r\n this.isUsingMultiplicationTokens = false;\r\n this.ruleConsideredAsLineBreak = null;\r\n }\r\n\r\n /**\r\n * @param {Grammar} grammar \r\n * @return {string}\r\n */\r\n convert(grammar) {\r\n return grammar.toBNF(this);\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/grammartobnf.js","import Rule from './rule';\r\nimport RRDiagram from '../ui/rrdiagram';\r\n\r\nexport default class GrammarToRRDiagram {\r\n\r\n constructor() {\r\n this.ruleLinkProvider = (ruleName) => '#' + ruleName;\r\n this.ruleConsideredAsLineBreak = null;\r\n }\r\n\r\n /**\r\n * @param {Rule} rule \r\n * @return {RRDiagram}\r\n */\r\n convert(rule) {\r\n return rule.toRRDiagram(this);\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./model/grammartorrdiagram.js","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-methods.js\n// module id = 26\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_defined.js\n// module id = 27\n// module chunks = 0","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-sap.js\n// module id = 28\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-primitive.js\n// module id = 29\n// module chunks = 0","var Map = require('./es6.map');\nvar $export = require('./_export');\nvar shared = require('./_shared')('metadata');\nvar store = shared.store || (shared.store = new (require('./es6.weak-map'))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_metadata.js\n// module id = 30\n// module chunks = 0","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_typed-array.js\n// module id = 31\n// module chunks = 0","import GrammarToRRDiagram from './grammartorrdiagram';\r\nimport GrammarToBNF from './grammartobnf';\r\nimport RRElement from '../ui/rrelement';\r\n\r\nexport default class Expression {\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n // Not reachable, we don't instanciate this class.\r\n return new RRElement();\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./model/expression.js","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_add-to-unscopables.js\n// module id = 33\n// module chunks = 0","module.exports = false;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_library.js\n// module id = 34\n// module chunks = 0","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_meta.js\n// module id = 35\n// module chunks = 0","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_an-instance.js\n// module id = 36\n// module chunks = 0","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_for-of.js\n// module id = 37\n// module chunks = 0","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-create.js\n// module id = 38\n// module chunks = 0","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-gopn.js\n// module id = 39\n// module chunks = 0","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-keys.js\n// module id = 40\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_property-desc.js\n// module id = 41\n// module chunks = 0","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_redefine-all.js\n// module id = 42\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_set-species.js\n// module id = 43\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-absolute-index.js\n// module id = 44\n// module chunks = 0","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_uid.js\n// module id = 45\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_validate-collection.js\n// module id = 46\n// module chunks = 0","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_classof.js\n// module id = 47\n// module chunks = 0","module.exports = {};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iterators.js\n// module id = 48\n// module chunks = 0","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_set-to-string-tag.js\n// module id = 49\n// module chunks = 0","var $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-trim.js\n// module id = 50\n// module chunks = 0","export default class LayoutInfo {\r\n\r\n /**\r\n * @param {number} width \r\n * @param {number} height \r\n * @param {number} connectorOffset \r\n */\r\n constructor(width, height, connectorOffset) {\r\n this.width = width;\r\n this.height = height;\r\n this.connectorOffset = connectorOffset;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n getWidth() {\r\n return this.width;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n getHeight() {\r\n return this.height;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n getConnectorOffset() {\r\n return this.connectorOffset;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/layoutinfo.js","import RRElement from './rrelement';\r\nimport RRDiagramToSVG from './rrdiagramtosvg';\r\nimport LayoutInfo from './layoutinfo';\r\nimport { escapeXml, getFontInfo } from '../utils/utils';\r\n\r\nconst Type = {\r\n LITERAL: 1,\r\n RULE: 2,\r\n SPECIAL_SEQUENCE: 3,\r\n};\r\n\r\nexport default class RRText extends RRElement {\r\n\r\n static get Type() {\r\n return Type;\r\n }\r\n\r\n /**\r\n * \r\n * @param {Type} type \r\n * @param {string} text \r\n * @param {?string} link \r\n */\r\n constructor(type, text, link) {\r\n super();\r\n this.type = type;\r\n this.text = text;\r\n this.link = link;\r\n this.fontInfo = null;\r\n }\r\n\r\n getType() {\r\n return this.type;\r\n }\r\n\r\n getText() {\r\n return this.text;\r\n }\r\n\r\n getLink() {\r\n return this.link;\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n const insets = {\r\n top: 5,\r\n left: 10,\r\n bottom: 5,\r\n right: 10,\r\n };\r\n let cssTextClass;\r\n if (this.type == Type.RULE) {\r\n cssTextClass = rrDiagramToSVG.cssRuleTextClass;\r\n } else if (this.type == Type.LITERAL) {\r\n cssTextClass = rrDiagramToSVG.cssLiteralTextClass;\r\n } else if (this.type == Type.SPECIAL_SEQUENCE) {\r\n cssTextClass = rrDiagramToSVG.cssSpecialSequenceTextClass;\r\n } else {\r\n throw 'Unknown type: type';\r\n }\r\n this.fontInfo = getFontInfo(this.text, cssTextClass);\r\n let width = this.fontInfo.textWidth;\r\n let height = this.fontInfo.height;\r\n const fontYOffset = this.fontInfo.descent;\r\n const connectorOffset = insets.top + height - fontYOffset;\r\n width += insets.left + insets.right;\r\n height += insets.top + insets.bottom;\r\n this.setLayoutInfo(new LayoutInfo(width, height, connectorOffset));\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n const insets = {\r\n top: 5,\r\n left: 10,\r\n bottom: 5,\r\n right: 10,\r\n };\r\n const layoutInfo = this.getLayoutInfo();\r\n const width = layoutInfo.getWidth();\r\n const height = layoutInfo.getHeight();\r\n if (this.link != null) {\r\n svgContent.addElement(\"<a xlink:href=\\\"\" + escapeXml(this.link)/* + \"\\\" xlink:title=\\\"\" + escapeXml(this.text)*/ + \"\\\">\");\r\n }\r\n let cssClass;\r\n let cssTextClass;\r\n let shape;\r\n if (this.type == Type.RULE) {\r\n cssClass = rrDiagramToSVG.cssRuleClass;\r\n cssTextClass = rrDiagramToSVG.cssRuleTextClass;\r\n shape = rrDiagramToSVG.ruleShape;\r\n } else if (this.type == Type.LITERAL) {\r\n cssClass = rrDiagramToSVG.cssLiteralClass;\r\n cssTextClass = rrDiagramToSVG.cssLiteralTextClass;\r\n shape = rrDiagramToSVG.literalShape;\r\n } else if (this.type == Type.SPECIAL_SEQUENCE) {\r\n cssClass = rrDiagramToSVG.cssSpecialSequenceClass;\r\n cssTextClass = rrDiagramToSVG.cssSpecialSequenceTextClass;\r\n shape = rrDiagramToSVG.specialSequenceShape;\r\n } else {\r\n throw 'Unknown type: type';\r\n }\r\n if (shape == RRDiagramToSVG.BoxShape.RECTANGLE) {\r\n svgContent.addElement(\"<rect class=\\\"\" + cssClass + \"\\\" x=\\\"\" + xOffset + \"\\\" y=\\\"\" + yOffset + \"\\\" width=\\\"\" + width + \"\\\" height=\\\"\" + height + \"\\\"/>\");\r\n } else if (shape == RRDiagramToSVG.BoxShape.ROUNDED_RECTANGLE) {\r\n const rx = Math.floor((insets.left + insets.right + insets.top + insets.bottom) / 4);\r\n svgContent.addElement(\"<rect class=\\\"\" + cssClass + \"\\\" x=\\\"\" + xOffset + \"\\\" y=\\\"\" + yOffset + \"\\\" width=\\\"\" + width + \"\\\" height=\\\"\" + height + \"\\\" rx=\\\"\" + rx + \"\\\"/>\");\r\n } else if (shape == RRDiagramToSVG.BoxShape.HEXAGON) {\r\n // We don't calculate the exact length of the connector: it goes behind the shape.\r\n // We should calculate if we want to support transparent shapes.\r\n const connectorOffset = layoutInfo.getConnectorOffset();\r\n svgContent.addLineConnector(xOffset, yOffset + connectorOffset, xOffset + insets.left, yOffset + connectorOffset);\r\n svgContent.addElement(\"<polygon class=\\\"\" + escapeXml(cssClass) + \"\\\" points=\\\"\" + xOffset + \" \" + (yOffset + Math.floor(height / 2)) + \" \" + (xOffset + insets.left) + \" \" + yOffset + \" \" + (xOffset + width - insets.right) + \" \" + yOffset + \" \" + (xOffset + width) + \" \" + (yOffset + Math.floor(height / 2)) + \" \" + (xOffset + width - insets.right) + \" \" + (yOffset + height) + \" \" + (xOffset + insets.left) + \" \" + (yOffset + height) + \"\\\"/>\");\r\n svgContent.addLineConnector(xOffset + width, yOffset + connectorOffset, xOffset + width - insets.right, yOffset + connectorOffset);\r\n }\r\n const fontYOffset = this.fontInfo.descent;\r\n const textHeight = this.fontInfo.textHeight;\r\n const textXOffset = xOffset + insets.left;\r\n const textYOffset = yOffset + insets.top + textHeight - fontYOffset;\r\n svgContent.addElement(\"<text class=\\\"\" + escapeXml(cssTextClass) + \"\\\" x=\\\"\" + textXOffset + \"\\\" y=\\\"\" + textYOffset + \"\\\">\" + escapeXml(this.text) + \"</text>\");\r\n if (this.link != null) {\r\n svgContent.addElement(\"</a>\");\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/rrtext.js","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_flags.js\n// module id = 53\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iobject.js\n// module id = 54\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-pie.js\n// module id = 55\n// module chunks = 0","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_shared.js\n// module id = 56\n// module chunks = 0","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_species-constructor.js\n// module id = 57\n// module chunks = 0","import RRDiagram from '../ui/rrdiagram';\r\nimport GrammarToBNF from './grammartobnf';\r\nimport Expression from './expression';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\n\r\nexport default class Rule {\r\n\r\n /**\r\n * @param {string} name \r\n * @param {Expression} expression \r\n * @param {?string} originalExpressionText \r\n */\r\n constructor(name, expression, originalExpressionText) {\r\n this.name = name;\r\n this.expression = expression;\r\n this.originalExpressionText = originalExpressionText;\r\n }\r\n\r\n /**\r\n * @return {string}\r\n */\r\n getName() {\r\n return this.name;\r\n }\r\n\r\n /**\r\n * @return {?string}\r\n */\r\n getOriginalExpressionText() {\r\n return this.originalExpressionText;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRDiagram}\r\n */\r\n toRRDiagram(grammarToRRDiagram) {\r\n return new RRDiagram(this.expression.toRRElement(grammarToRRDiagram));\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @return {string}\r\n */\r\n toBNF(grammarToBNF) {\r\n const sb = [];\r\n sb.push(this.name, \" \");\r\n switch (grammarToBNF.ruleDefinitionSign) {\r\n case GrammarToBNF.RuleDefinitionSign.EQUAL: sb.push(\"=\"); break;\r\n case GrammarToBNF.RuleDefinitionSign.COLON_EQUAL: sb.push(\":=\"); break;\r\n case GrammarToBNF.RuleDefinitionSign.COLON_COLON_EQUAL: sb.push(\"::=\"); break;\r\n }\r\n sb.push(\" \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n sb.push(\";\");\r\n return sb.join(\"\");\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/rule.js","import RRElement from './rrelement';\r\nimport RRSequence from './rrsequence';\r\nimport SvgContent from './svg/svgcontent';\r\nimport RRBreak from './rrbreak';\r\n\r\nexport default class RRDiagram {\r\n\r\n /**\r\n * @param {RRElement} rrElement \r\n */\r\n constructor(rrElement) {\r\n this.rrElement = rrElement;\r\n }\r\n\r\n toSVG(rrDiagramToSVG) {\r\n const rrElementList = [];\r\n if (this.rrElement instanceof RRSequence) {\r\n const cursorElementList = [];\r\n for (let element of this.rrElement.getRRElements()) {\r\n if (element instanceof RRBreak) {\r\n if (cursorElementList.length != 0) {\r\n rrElementList.push(cursorElementList.length == 1 ? cursorElementList[0] : new RRSequence(cursorElementList.slice()));\r\n cursorElementList.length = 0;\r\n }\r\n } else {\r\n cursorElementList.push(element);\r\n }\r\n }\r\n if (cursorElementList.length != 0) {\r\n rrElementList.push(cursorElementList.length == 1 ? cursorElementList[0] : new RRSequence(cursorElementList.slice()));\r\n }\r\n } else {\r\n rrElementList.push(this.rrElement);\r\n }\r\n let width = 5;\r\n let height = 5;\r\n for (let i = 0; i < rrElementList.length; i++) {\r\n if (i > 0) {\r\n height += 5;\r\n }\r\n const rrElement_ = rrElementList[i];\r\n rrElement_.computeLayoutInfo(rrDiagramToSVG);\r\n const layoutInfo = rrElement_.getLayoutInfo();\r\n width = Math.max(width, 5 + layoutInfo.getWidth() + 5);\r\n height += layoutInfo.getHeight() + 5;\r\n }\r\n const svgContent = new SvgContent();\r\n // First, generate the XML for the elements, to know the usage.\r\n const xOffset = 0;\r\n let yOffset = 5;\r\n for (let rrElement_ of rrElementList) {\r\n const layoutInfo2 = rrElement_.getLayoutInfo();\r\n const connectorOffset2 = layoutInfo2.getConnectorOffset();\r\n const width2 = layoutInfo2.getWidth();\r\n const height2 = layoutInfo2.getHeight();\r\n const y1 = yOffset + connectorOffset2;\r\n svgContent.addLineConnector(xOffset, y1, xOffset + 5, y1);\r\n // TODO: add decorations (like arrows)?\r\n rrElement_.toSVG(rrDiagramToSVG, xOffset + 5, yOffset, svgContent);\r\n svgContent.addLineConnector(xOffset + 5 + width2, y1, xOffset + 5 + width2 + 5, y1);\r\n yOffset += height2 + 10;\r\n }\r\n const connectorElement = svgContent.getConnectorElement(rrDiagramToSVG);\r\n const elements = svgContent.getElements();\r\n // Then generate the rest (CSS and SVG container tags) based on that usage.\r\n const sb = [];\r\n sb.push(\"<svg version=\\\"1.1\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"\", width, \"\\\" height=\\\"\", height, \"\\\" viewbox=\\\"0 0 \" + width + \" \" + height + \"\\\">\");\r\n /* String styles = svgContent.getCSSStyles();\r\n if(styles.length() > 0) {\r\n sb.push(\"<defs><style type=\\\"text/css\\\">\");\r\n sb.push(styles);\r\n sb.push(\"</style></defs>\");\r\n }*/\r\n sb.push(connectorElement);\r\n sb.push(elements);\r\n sb.push(\"</svg>\");\r\n return sb.join(\"\");\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/rrdiagram.js","import RRText from './rrtext';\r\nimport RRDiagram from './rrdiagram'\r\n\r\nconst BoxShape = {\r\n RECTANGLE: 1,\r\n ROUNDED_RECTANGLE: 2,\r\n HEXAGON: 3,\r\n};\r\n\r\nexport default class RRDiagramToSVG {\r\n\r\n static get BoxShape() {\r\n return BoxShape;\r\n }\r\n\r\n constructor() {\r\n this.cssConnectorClass = \"rrConnector\";//{fill:none;stroke:#222222;}\r\n this.cssRuleClass = \"rrRule\";//{fill:#d3f0ff;stroke:#222222;}\r\n this.cssRuleTextClass = \"rrRuleText\";//{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\r\n this.cssLiteralClass = \"rrLiteral\";//{fill:#90d9ff;stroke:#222222;}\r\n this.cssLiteralTextClass = \"rrLiteralText\";//{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\r\n this.cssSpecialSequenceClass = \"rrSpecialSequence\";//{fill:#e4f4ff;stroke:#222222;}\r\n this.cssSpecialSequenceTextClass = \"rrSpecialSequenceText\";//{fill:#000000;font-family:Verdana,Sans-serif;font-size:12px;}\r\n this.cssLoopCardinalitiesTextClass = \"rrLoopCardinalities\";//{fill:#000000;font-family:Verdana,Sans-serif;font-size:10px;}\r\n this.ruleShape = BoxShape.RECTANGLE;\r\n this.literalShape = BoxShape.ROUNDED_RECTANGLE;\r\n this.specialSequenceShape = BoxShape.HEXAGON;\r\n }\r\n\r\n /**\r\n * @param {RRDiagram} rrDiagram \r\n * @return {string}\r\n */\r\n convert(rrDiagram) {\r\n return rrDiagram.toSVG(this);\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/rrdiagramtosvg.js","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-includes.js\n// module id = 61\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_collection.js\n// module id = 62\n// module chunks = 0","'use strict';\nrequire('./es6.regexp.exec');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\nvar regexpExec = require('./_regexp-exec');\n\nvar SPECIES = wks('species');\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n // #replace needs built-in support for named groups.\n // #match works fine because it just return the exec results, even if it has\n // a \"grops\" property.\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$<a>') !== '7';\n});\n\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {\n // Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length === 2 && result[0] === 'a' && result[1] === 'b';\n})();\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n re.exec = function () { execCalled = true; return null; };\n if (KEY === 'split') {\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n }\n re[SYMBOL]('');\n return !execCalled;\n }) : undefined;\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||\n (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var fns = exec(\n defined,\n SYMBOL,\n ''[KEY],\n function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {\n if (regexp.exec === regexpExec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n }\n );\n var strfn = fns[0];\n var rxfn = fns[1];\n\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_fix-re-wks.js\n// module id = 63\n// module chunks = 0","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_is-array.js\n// module id = 64\n// module chunks = 0","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_is-regexp.js\n// module id = 65\n// module chunks = 0","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iter-detect.js\n// module id = 66\n// module chunks = 0","'use strict';\n// Forced replacement prototype accessors methods\nmodule.exports = require('./_library') || !require('./_fails')(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete require('./_global')[K];\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-forced-pam.js\n// module id = 67\n// module chunks = 0","exports.f = Object.getOwnPropertySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-gops.js\n// module id = 68\n// module chunks = 0","'use strict';\n\nvar classof = require('./_classof');\nvar builtinExec = RegExp.prototype.exec;\n\n // `RegExpExec` abstract operation\n// https://tc39.github.io/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw new TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n if (classof(R) !== 'RegExp') {\n throw new TypeError('RegExp#exec called on incompatible receiver');\n }\n return builtinExec.call(R, S);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_regexp-exec-abstract.js\n// module id = 69\n// module chunks = 0","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_set-collection-from.js\n// module id = 70\n// module chunks = 0","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_set-collection-of.js\n// module id = 71\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-at.js\n// module id = 72\n// module chunks = 0","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_typed.js\n// module id = 73\n// module chunks = 0","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_user-agent.js\n// module id = 74\n// module chunks = 0","import Rule from './rule';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class Grammar {\r\n\r\n constructor(rules) {\r\n if(arguments.length == 0) {\r\n rules = [];\r\n } else if (rules.constructor !== Array) {\r\n rules = arguments;\r\n }\r\n this.rules = rules;\r\n }\r\n\r\n /**\r\n * @return {Rule[]}\r\n */\r\n getRules() {\r\n return this.rules;\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @return {string}\r\n */\r\n toBNF(grammarToBNF) {\r\n const sb = [];\r\n for (let i = 0; i < this.rules.length; i++) {\r\n if (i > 0) {\r\n sb.push(\"\\n\");\r\n }\r\n sb.push(this.rules[i].toBNF(grammarToBNF));\r\n }\r\n return sb.join(\"\");\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/grammar.js","import Expression from './expression';\r\nimport RRText from '../ui/rrtext';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class Literal extends Expression {\r\n\r\n /**\r\n * @param {string} text \r\n */\r\n constructor(text) {\r\n super();\r\n this.text = text;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n return new RRText(RRText.Type.LITERAL, this.text, null);\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n const c = grammarToBNF.literalDefinitionSign == GrammarToBNF.LiteralDefinitionSign.DOUBLE_QUOTE ? '\"' : '\\'';\r\n sb.push(c);\r\n sb.push(this.text);\r\n sb.push(c);\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof Literal)) {\r\n return false;\r\n }\r\n return this.text == o.text;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/literal.js","import Expression from './expression';\r\nimport RRChoice from '../ui/rrchoice';\r\nimport RRLine from '../ui/rrline';\r\nimport RRLoop from '../ui/rrloop';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class Repetition extends Expression {\r\n\r\n /**\r\n * @param {Expression} expression \r\n * @param {number} minRepetitionCount \r\n * @param {?number} maxRepetitionCount \r\n */\r\n constructor(expression, minRepetitionCount, maxRepetitionCount) {\r\n super();\r\n this.expression = expression;\r\n this.minRepetitionCount = minRepetitionCount | 0;\r\n this.maxRepetitionCount = maxRepetitionCount;\r\n }\r\n\r\n /**\r\n * @return {Expression}\r\n */\r\n getExpression() {\r\n return this.expression;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n getMinRepetitionCount() {\r\n return this.minRepetitionCount;\r\n }\r\n\r\n /**\r\n * @return {?number}\r\n */\r\n getMaxRepetitionCount() {\r\n return this.maxRepetitionCount;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n const rrElement = this.expression.toRRElement(grammarToRRDiagram);\r\n if (this.minRepetitionCount == 0) {\r\n if (this.maxRepetitionCount == null || this.maxRepetitionCount > 1) {\r\n return new RRChoice(new RRLoop(rrElement, null, 0, (this.maxRepetitionCount == null ? null : this.maxRepetitionCount - 1)), new RRLine());\r\n }\r\n return new RRChoice(rrElement, new RRLine());\r\n }\r\n return new RRLoop(rrElement, null, this.minRepetitionCount - 1, (this.maxRepetitionCount == null ? null : this.maxRepetitionCount - 1));\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n const isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\r\n if (this.maxRepetitionCount == null) {\r\n if (this.minRepetitionCount > 0) {\r\n if (this.minRepetitionCount == 1 && isUsingMultiplicationTokens) {\r\n this.expression.toBNF(grammarToBNF, sb, true);\r\n sb.push(\"+\");\r\n } else {\r\n if (isNested) {\r\n sb.push(\"( \");\r\n }\r\n if (this.minRepetitionCount > 1) {\r\n sb.push(this.minRepetitionCount, \" * \");\r\n }\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n if (grammarToBNF.isCommaSeparator) {\r\n sb.push(\" ,\");\r\n }\r\n sb.push(\" \", \"{ \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n sb.push(\" }\");\r\n if (isNested) {\r\n sb.push(\" )\");\r\n }\r\n }\r\n } else {\r\n if (isUsingMultiplicationTokens) {\r\n this.expression.toBNF(grammarToBNF, sb, true);\r\n sb.push(\"*\");\r\n } else {\r\n sb.push(\"{ \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n sb.push(\" }\");\r\n }\r\n }\r\n } else {\r\n if (this.minRepetitionCount == 0) {\r\n if (this.maxRepetitionCount == 1 && isUsingMultiplicationTokens) {\r\n this.expression.toBNF(grammarToBNF, sb, true);\r\n sb.push(\"?\");\r\n } else {\r\n if (this.maxRepetitionCount > 1) {\r\n sb.push(this.maxRepetitionCount, \" * \");\r\n }\r\n sb.push(\"[ \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n sb.push(\" ]\");\r\n }\r\n } else {\r\n if (this.minRepetitionCount == this.maxRepetitionCount) {\r\n sb.push(this.minRepetitionCount, \" * \");\r\n this.expression.toBNF(grammarToBNF, sb, isNested);\r\n } else {\r\n if (isNested) {\r\n sb.push(\"( \");\r\n }\r\n sb.push(this.minRepetitionCount, \" * \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n if (grammarToBNF.isCommaSeparator) {\r\n sb.push(\" ,\");\r\n }\r\n sb.push(\" \", this.maxRepetitionCount - this.minRepetitionCount, \" * \", \"[ \");\r\n this.expression.toBNF(grammarToBNF, sb, false);\r\n sb.push(\" ]\");\r\n if (isNested) {\r\n sb.push(\" )\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof Repetition)) {\r\n return false;\r\n }\r\n return this.expression.equals(o.expression) && this.minRepetitionCount == o.minRepetitionCount && this.maxRepetitionCount == null? o.maxRepetitionCount == null: this.maxRepetitionCount.equals(o.maxRepetitionCount);\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/repetition.js","import Expression from './expression';\r\nimport RRBreak from '../ui/rrbreak';\r\nimport RRText from '../ui/rrtext';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class RuleReference extends Expression {\r\n\r\n /**\r\n * @param {string} ruleName \r\n */\r\n constructor(ruleName) {\r\n super();\r\n this.ruleName = ruleName;\r\n }\r\n\r\n getRuleName() {\r\n return this.ruleName;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n const ruleConsideredAsLineBreak = grammarToRRDiagram.ruleConsideredAsLineBreak;\r\n if (ruleConsideredAsLineBreak != null && ruleConsideredAsLineBreak === this.ruleName) {\r\n return new RRBreak();\r\n }\r\n const ruleLinkProvider = grammarToRRDiagram.ruleLinkProvider;\r\n return new RRText(RRText.Type.RULE, this.ruleName, ruleLinkProvider == null ? null : ruleLinkProvider(this.ruleName));\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n sb.push(this.ruleName);\r\n const ruleConsideredAsLineBreak = grammarToBNF.ruleConsideredAsLineBreak;\r\n if (ruleConsideredAsLineBreak != null && ruleConsideredAsLineBreak === this.ruleName) {\r\n sb.push(\"\\n\");\r\n }\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof RuleReference)) {\r\n return false;\r\n }\r\n return this.ruleName == o.ruleName;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/rulereference.js","import Expression from './expression';\r\nimport RRLoop from '../ui/rrloop';\r\nimport RRSequence from '../ui/rrsequence';\r\nimport RuleReference from './rulereference';\r\nimport Repetition from './repetition';\r\nimport Literal from './literal';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class Sequence extends Expression {\r\n\r\n /**\r\n * @param {(Expression | Expression[])} expressions \r\n */\r\n constructor(expressions) {\r\n super();\r\n if (arguments.length == 0) {\r\n expressions = [];\r\n } else if (expressions.constructor !== Array) {\r\n expressions = arguments;\r\n }\r\n this.expressions = expressions;\r\n }\r\n\r\n /**\r\n * @param {Expression[]}\r\n */\r\n getExpressions() {\r\n return this.expressions;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n const rrElementList = [];\r\n for (let i = 0; i < this.expressions.length; i++) {\r\n const expression = this.expressions[i];\r\n let rrElement = expression.toRRElement(grammarToRRDiagram);\r\n // Treat special case of: \"a (',' a)*\" and \"a (a)*\"\r\n if (i < this.expressions.length - 1 && this.expressions[i + 1] instanceof Repetition) {\r\n const repetition = this.expressions[i + 1];\r\n const repetitionExpression = repetition.getExpression();\r\n if (repetitionExpression instanceof Sequence) {\r\n // Treat special case of: \"expr (',' expr)*\"\r\n const subExpressions = repetitionExpression.getExpressions();\r\n if (subExpressions.length == 2 && subExpressions[0] instanceof Literal) {\r\n if(expression.equals(subExpressions[1])) {\r\n const maxRepetitionCount = repetition.getMaxRepetitionCount();\r\n if (maxRepetitionCount == null || maxRepetitionCount > 1) {\r\n rrElement = new RRLoop(expression.toRRElement(grammarToRRDiagram), subExpressions[0].toRRElement(grammarToRRDiagram), repetition.getMinRepetitionCount(), (maxRepetitionCount == null ? null : maxRepetitionCount));\r\n i++;\r\n }\r\n }\r\n }\r\n } else if(expression instanceof RuleReference) {\r\n const ruleLink = expression;\r\n // Treat special case of: a (a)*\r\n if (repetitionExpression instanceof RuleReference && repetitionExpression.getRuleName().equals(ruleLink.getRuleName())) {\r\n const maxRepetitionCount = repetition.getMaxRepetitionCount();\r\n if (maxRepetitionCount == null || maxRepetitionCount > 1) {\r\n rrElement = new RRLoop(ruleLink.toRRElement(grammarToRRDiagram), null, repetition.getMinRepetitionCount(), (maxRepetitionCount == null ? null : maxRepetitionCount));\r\n i++;\r\n }\r\n }\r\n }\r\n }\r\n rrElementList.push(rrElement);\r\n }\r\n return new RRSequence(rrElementList);\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n if (this.expressions.length == 0) {\r\n sb.push(\"( )\");\r\n return;\r\n }\r\n if (isNested && this.expressions.length > 1) {\r\n sb.push(\"( \");\r\n }\r\n const isCommaSeparator = grammarToBNF.isCommaSeparator;\r\n for (let i = 0; i < this.expressions.length; i++) {\r\n if (i > 0) {\r\n if (isCommaSeparator) {\r\n sb.push(\" ,\");\r\n }\r\n sb.push(\" \");\r\n }\r\n this.expressions[i].toBNF(grammarToBNF, sb, this.expressions.length == 1 && isNested || !isCommaSeparator);\r\n }\r\n if (isNested && this.expressions.length > 1) {\r\n sb.push(\" )\");\r\n }\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof Sequence)) {\r\n return false;\r\n }\r\n if(this.expressions.length != o.expressions.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < this.expressions.length; i++) {\r\n if(!this.expressions[i].equals(o.expressions[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/sequence.js","import RRElement from './rrelement';\r\nexport default class RRBreak extends RRElement {\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n throw \"This element must not be nested and should have been processed before entering generation.\";\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n throw \"This element must not be nested and should have been processed before entering generation.\";\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/rrbreak.js","import RRElement from './rrelement';\r\nimport LayoutInfo from './layoutinfo';\r\n\r\nexport default class RRChoice extends RRElement {\r\n\r\n /**\r\n * @param {(RRElement[] | RRElement)} rrElements \r\n */\r\n constructor(rrElements) {\r\n super();\r\n if(arguments.length == 0) {\r\n rrElements = [];\r\n } else if(rrElements.constructor !== Array) {\r\n rrElements = arguments;\r\n }\r\n this.rrElements = rrElements;\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n let width = 0;\r\n let height = 0;\r\n let connectorOffset = 0;\r\n for (let i = 0; i < this.rrElements.length; i++) {\r\n const rrElement = this.rrElements[i];\r\n rrElement.computeLayoutInfo(rrDiagramToSVG);\r\n const layoutInfo = rrElement.getLayoutInfo();\r\n if (i == 0) {\r\n connectorOffset = layoutInfo.getConnectorOffset();\r\n } else {\r\n height += 5;\r\n }\r\n height += layoutInfo.getHeight();\r\n width = Math.max(width, layoutInfo.getWidth());\r\n }\r\n width += 20 + 20;\r\n this.setLayoutInfo(new LayoutInfo(width, height, connectorOffset));\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n const layoutInfo = this.getLayoutInfo();\r\n const y1 = yOffset + layoutInfo.getConnectorOffset();\r\n const x1 = xOffset + 10;\r\n const x2 = xOffset + layoutInfo.getWidth() - 10;\r\n const xOffset2 = xOffset + 20;\r\n let y2 = 0;\r\n let yOffset2 = yOffset;\r\n for (let i = 0; i < this.rrElements.length; i++) {\r\n const rrElement = this.rrElements[i];\r\n const layoutInfo2 = rrElement.getLayoutInfo();\r\n const width = layoutInfo2.getWidth();\r\n const height = layoutInfo2.getHeight();\r\n y2 = yOffset2 + layoutInfo2.getConnectorOffset();\r\n if (i == 0) {\r\n // Line to first element\r\n svgContent.addLineConnector(x1 - 10, y1, x1 + 10, y1);\r\n } else {\r\n if (i == this.rrElements.length - 1) {\r\n // Curve and vertical down\r\n svgContent.addPathConnector(x1 - 5, y1, \"q5 0 5 5\", x1, y1 + 5);\r\n svgContent.addLineConnector(x1, y1 + 5, x1, y2 - 5);\r\n }\r\n // Curve and horizontal line to element\r\n svgContent.addPathConnector(x1, y2 - 5, \"q0 5 5 5\", x1 + 5, y2);\r\n svgContent.addLineConnector(x1 + 5, y2, xOffset2, y2);\r\n }\r\n rrElement.toSVG(rrDiagramToSVG, xOffset2, yOffset2, svgContent);\r\n if (i == 0) {\r\n // Line to first element\r\n svgContent.addLineConnector(xOffset2 + width, y2, x2 + 10, y2);\r\n } else {\r\n // Horizontal line to element and curve\r\n svgContent.addLineConnector(x2 - 5, y2, xOffset2 + width, y2);\r\n svgContent.addPathConnector(x2 - 5, y2, \"q5 0 5-5\", x2, y2 - 5);\r\n if (i == this.rrElements.length - 1) {\r\n // Vertical up and curve\r\n svgContent.addLineConnector(x2, y2 - 5, x2, y1 + 5);\r\n svgContent.addPathConnector(x2, y1 + 5, \"q0-5 5-5\", x2 + 5, y1);\r\n }\r\n }\r\n yOffset2 += height + 5;\r\n }\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/rrchoice.js","import RRElement from './rrelement';\r\nimport RRDiagramToSVG from './rrdiagramtosvg';\r\nimport LayoutInfo from './layoutinfo';\r\nimport { escapeXml, getFontInfo } from '../utils/utils';\r\n\r\nexport default class RRLoop extends RRElement {\r\n\r\n /**\r\n * @param {RRElement} rrElement \r\n * @param {RRElement} loopElement \r\n * @param {?number} minRepetitionCount \r\n * @param {?number} maxRepetitionCount \r\n */\r\n constructor(rrElement, loopElement, minRepetitionCount, maxRepetitionCount) {\r\n super();\r\n this.rrElement = rrElement;\r\n this.loopElement = loopElement;\r\n if (minRepetitionCount < 0) {\r\n throw new IllegalArgumentException(\"Minimum repetition must be positive!\");\r\n }\r\n if (maxRepetitionCount != null && maxRepetitionCount < minRepetitionCount) {\r\n throw new IllegalArgumentException(\"Maximum repetition must not be smaller than minimum!\");\r\n }\r\n this.minRepetitionCount = minRepetitionCount;\r\n this.maxRepetitionCount = maxRepetitionCount;\r\n this.cardinalitiesText = null;\r\n this.cardinalitiesWidth = null;\r\n this.fontYOffset = null;\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n this.cardinalitiesText = null;\r\n this.cardinalitiesWidth = 0;\r\n this.fontYOffset = 0;\r\n if (this.minRepetitionCount > 0 || this.maxRepetitionCount != null) {\r\n this.cardinalitiesText = this.minRepetitionCount + \"..\" + (this.maxRepetitionCount == null ? \"N\" : this.maxRepetitionCount);\r\n // TODO: get font from CSS tag.\r\n const fontInfo = getFontInfo(this.cardinalitiesText, rrDiagramToSVG.cssLoopCardinalitiesTextClass);\r\n this.fontYOffset = fontInfo.descent;\r\n this.cardinalitiesWidth = fontInfo.textWidth + 2;\r\n }\r\n this.rrElement.computeLayoutInfo(rrDiagramToSVG);\r\n const layoutInfo1 = this.rrElement.getLayoutInfo();\r\n let width = layoutInfo1.getWidth();\r\n let height = layoutInfo1.getHeight();\r\n let connectorOffset = layoutInfo1.getConnectorOffset();\r\n if (this.loopElement != null) {\r\n this.loopElement.computeLayoutInfo(rrDiagramToSVG);\r\n const layoutInfo2 = this.loopElement.getLayoutInfo();\r\n width = Math.max(width, layoutInfo2.getWidth());\r\n const height2 = layoutInfo2.getHeight();\r\n height += 5 + height2;\r\n connectorOffset += 5 + height2;\r\n } else {\r\n height += 15;\r\n connectorOffset += 15;\r\n }\r\n width += 20 + 20 + this.cardinalitiesWidth;\r\n this.setLayoutInfo(new LayoutInfo(width, height, connectorOffset));\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n const layoutInfo1 = this.rrElement.getLayoutInfo();\r\n const width1 = layoutInfo1.getWidth();\r\n let maxWidth = width1;\r\n let yOffset2 = yOffset;\r\n const layoutInfo = this.getLayoutInfo();\r\n const connectorOffset = layoutInfo.getConnectorOffset();\r\n let y1 = yOffset;\r\n let loopOffset = 0;\r\n let loopWidth = 0;\r\n if (this.loopElement != null) {\r\n const layoutInfo2 = this.loopElement.getLayoutInfo();\r\n loopWidth = layoutInfo2.getWidth();\r\n maxWidth = Math.max(maxWidth, loopWidth);\r\n loopOffset = xOffset + 20 + Math.floor((maxWidth - loopWidth) / 2);\r\n yOffset2 += 5 + layoutInfo2.getHeight();\r\n y1 += layoutInfo2.getConnectorOffset();\r\n } else {\r\n yOffset2 += 15;\r\n y1 += 5;\r\n }\r\n const x1 = xOffset + 10;\r\n const x2 = xOffset + 20 + maxWidth + 10 + this.cardinalitiesWidth;\r\n const y2 = yOffset + connectorOffset;\r\n svgContent.addLineConnector(x1 - 10, y2, x1 + 10 + Math.floor((maxWidth - width1) / 2), y2);\r\n let loopPathStartX = x1 + 5;\r\n svgContent.addPathConnector(x1 + 5, y2, \"q-5 0-5-5\", x1, y2 - 5);\r\n svgContent.addLineConnector(x1, y2 - 5, x1, y1 + 5);\r\n svgContent.addPathConnector(x1, y1 + 5, \"q0-5 5-5\", x1 + 5, y1);\r\n if (this.loopElement != null) {\r\n svgContent.addLineConnector(x1 + 5, y1, loopOffset, y1);\r\n this.loopElement.toSVG(rrDiagramToSVG, loopOffset, yOffset, svgContent);\r\n loopPathStartX = loopOffset + loopWidth;\r\n }\r\n svgContent.addLineConnector(loopPathStartX, y1, x2 - 5, y1);\r\n svgContent.addPathConnector(x2 - 5, y1, \"q5 0 5 5\", x2, y1 + 5);\r\n svgContent.addLineConnector(x2, y1 + 5, x2, y2 - 5);\r\n svgContent.addPathConnector(x2, y2 - 5, \"q0 5-5 5\", x2 - 5, y2);\r\n if (this.cardinalitiesText != null) {\r\n svgContent.addElement(\"<text class=\\\"\" + escapeXml(rrDiagramToSVG.cssLoopCardinalitiesTextClass) + \"\\\" x=\\\"\" + (x2 - this.cardinalitiesWidth) + \"\\\" y=\\\"\" + (y2 - this.fontYOffset - 5) + \"\\\">\" + escapeXml(this.cardinalitiesText) + \"</text>\");\r\n }\r\n this.rrElement.toSVG(rrDiagramToSVG, xOffset + 20 + Math.floor((maxWidth - width1) / 2), yOffset2, svgContent);\r\n svgContent.addLineConnector(x2 - this.cardinalitiesWidth - 10 - Math.floor((maxWidth - width1) / 2), y2, xOffset + layoutInfo.getWidth(), y2);\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/rrloop.js","import RRElement from './rrelement';\r\nimport LayoutInfo from './layoutinfo';\r\n\r\nexport default class RRSequence extends RRElement {\r\n\r\n\r\n /**\r\n * @param {(RRElement | RRElement[])} rrElements \r\n */\r\n constructor(rrElements) {\r\n super();\r\n if(arguments.length == 0) {\r\n rrElements = [];\r\n } else if(rrElements.constructor !== Array) {\r\n rrElements = arguments;\r\n }\r\n this.rrElements = rrElements;\r\n }\r\n\r\n getRRElements() {\r\n return this.rrElements;\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n let width = 0;\r\n let aboveConnector = 0;\r\n let belowConnector = 0;\r\n for (let i = 0; i < this.rrElements.length; i++) {\r\n const rrElement = this.rrElements[i];\r\n rrElement.computeLayoutInfo(rrDiagramToSVG);\r\n if (i > 0) {\r\n width += 10;\r\n }\r\n const layoutInfo = rrElement.getLayoutInfo();\r\n width += layoutInfo.getWidth();\r\n const height = layoutInfo.getHeight();\r\n const connectorOffset = layoutInfo.getConnectorOffset();\r\n aboveConnector = Math.max(aboveConnector, connectorOffset);\r\n belowConnector = Math.max(belowConnector, height - connectorOffset);\r\n }\r\n this.setLayoutInfo(new LayoutInfo(width, aboveConnector + belowConnector, aboveConnector));\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n const layoutInfo = this.getLayoutInfo();\r\n const connectorOffset = layoutInfo.getConnectorOffset();\r\n let widthOffset = 0;\r\n for (let i = 0; i < this.rrElements.length; i++) {\r\n const rrElement = this.rrElements[i];\r\n const layoutInfo2 = rrElement.getLayoutInfo();\r\n const width2 = layoutInfo2.getWidth();\r\n const connectorOffset2 = layoutInfo2.getConnectorOffset();\r\n const xOffset2 = widthOffset + xOffset;\r\n const yOffset2 = yOffset + connectorOffset - connectorOffset2;\r\n if (i > 0) {\r\n svgContent.addLineConnector(xOffset2 - 10, yOffset + connectorOffset, xOffset2, yOffset + connectorOffset);\r\n }\r\n rrElement.toSVG(rrDiagramToSVG, xOffset2, yOffset2, svgContent);\r\n widthOffset += 10;\r\n widthOffset += width2;\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/rrsequence.js","/**\r\n * @param {string} unsafe \r\n * @return {string}\r\n */\r\nexport function escapeXml(unsafe) {\r\n return unsafe.replace(/[<>&'\"]/g, function (c) {\r\n switch (c) {\r\n case '<': return '&lt;';\r\n case '>': return '&gt;';\r\n case '&': return '&amp;';\r\n case '\\'': return '&apos;';\r\n case '\"': return '&quot;';\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @param {string} text\r\n * @param {string} fontCssClass\r\n * @return {{textWidth: number, textHeight: number, descent: number, height: number}}\r\n */\r\nexport function getFontInfo(text, fontCssClass) {\r\n // TODO: add caching of fontInfo per CssClass\r\n // Code inspired from: https://galactic.ink/journal/2011/01/html5-typographic-metrics/\r\n const container = document.body;\r\n const testDiv = document.createElement(\"div\");\r\n testDiv.className = fontCssClass;\r\n container.appendChild(testDiv);\r\n const computedStyle = window.getComputedStyle(testDiv, null);\r\n const fontSize = computedStyle.getPropertyValue('font-size');\r\n const fontFamily = computedStyle.getPropertyValue('font-family');\r\n container.removeChild(testDiv);\r\n const parent = document.createElement(\"div\");\r\n parent.style.fontFamily = fontFamily;\r\n parent.style.fontSize = fontSize;\r\n const image = document.createElement(\"img\");\r\n image.width = 1;\r\n image.height = 1;\r\n //image.src = \"./media/1x1.png\";\r\n image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGP6DwABBQECz6AuzQAAAABJRU5ErkJggg==';\r\n const sampleHeight = 500;\r\n const textNode = document.createTextNode(text);\r\n parent.appendChild(textNode);\r\n parent.appendChild(image);\r\n container.appendChild(parent);\r\n // getting css equivalent of ctx.measureText()\r\n image.style.display = \"none\";\r\n parent.style.display = \"inline\";\r\n const textHeight = parent.offsetHeight;\r\n const textWidth = parent.offsetWidth;\r\n // making sure super-wide text stays in-bounds\r\n image.style.display = \"inline\";\r\n const forceWidth = textWidth + image.offsetWidth;\r\n // capturing the \"top\" and \"bottom\" baseline\r\n parent.style.cssText = \"margin: \" + sampleHeight + \"px 0; display: block; width: \" + forceWidth + \"px; white-space: nowrap; overflow: hidden; position: absolute; top: 0;\";\r\n parent.style.fontFamily = fontFamily;\r\n parent.style.fontSize = fontSize;\r\n const descent = textHeight - image.offsetTop;\r\n const height = parent.offsetHeight;\r\n const fontInfo = {\r\n textWidth,\r\n textHeight,\r\n descent,\r\n height,\r\n };\r\n container.removeChild(parent);\r\n return fontInfo;\r\n}\n\n\n// WEBPACK FOOTER //\n// ./utils/utils.js","'use strict';\nvar at = require('./_string-at')(true);\n\n // `AdvanceStringIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? at(S, index).length : 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_advance-string-index.js\n// module id = 85\n// module chunks = 0","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-fill.js\n// module id = 86\n// module chunks = 0","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-species-create.js\n// module id = 87\n// module chunks = 0","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_create-property.js\n// module id = 88\n// module chunks = 0","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_dom-create.js\n// module id = 89\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_enum-bug-keys.js\n// module id = 90\n// module chunks = 0","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_fails-is-regexp.js\n// module id = 91\n// module chunks = 0","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_html.js\n// module id = 92\n// module chunks = 0","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_inherit-if-required.js\n// module id = 93\n// module chunks = 0","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_is-array-iter.js\n// module id = 94\n// module chunks = 0","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iter-create.js\n// module id = 95\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iter-define.js\n// module id = 96\n// module chunks = 0","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_math-expm1.js\n// module id = 97\n// module chunks = 0","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_math-sign.js\n// module id = 98\n// module chunks = 0","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_microtask.js\n// module id = 99\n// module chunks = 0","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_new-promise-capability.js\n// module id = 100\n// module chunks = 0","'use strict';\n\nvar regexpFlags = require('./_flags');\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar LAST_INDEX = 'lastIndex';\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/,\n re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;\n})();\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + re.source + '$(?!\\\\s)', regexpFlags.call(re));\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];\n\n match = nativeExec.call(re, str);\n\n if (UPDATES_LAST_INDEX_WRONG && match) {\n re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n // eslint-disable-next-line no-loop-func\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_regexp-exec.js\n// module id = 101\n// module chunks = 0","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_set-proto.js\n// module id = 102\n// module chunks = 0","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_shared-key.js\n// module id = 103\n// module chunks = 0","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-context.js\n// module id = 104\n// module chunks = 0","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-repeat.js\n// module id = 105\n// module chunks = 0","module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-ws.js\n// module id = 106\n// module chunks = 0","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_task.js\n// module id = 107\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_typed-buffer.js\n// module id = 108\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_wks-define.js\n// module id = 109\n// module chunks = 0","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/core.get-iterator-method.js\n// module id = 110\n// module chunks = 0","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.iterator.js\n// module id = 111\n// module chunks = 0","import Chunk from './chunk';\r\nimport Rule from './rule';\r\nimport Grammar from './grammar';\r\n\r\n/**\r\n * @param {string} name\r\n * @param {Chunk} chunk\r\n * @param {string} originalExpressionText\r\n */\r\nfunction createRule(name, chunk, originalExpressionText) {\r\n chunk.prune();\r\n const expression = chunk.getExpression();\r\n const rule = new Rule(name, expression, originalExpressionText);\r\n return rule;\r\n}\r\n\r\n/**\r\n * @param {Chunk} parentChunk\r\n * @param {function(): string} readNext\r\n * @param {string} stopChar\r\n * @return {string}\r\n */\r\nfunction loadExpression(parentChunk, readNext, stopChar) {\r\n const expressionTextSB = [];\r\n let lastChar = 0;\r\n const sb = [];\r\n let isFirst = true;\r\n let isInSpecialGroup = false;\r\n let specialGroupChar = 0;\r\n const isLiteral = parentChunk.getType() == Chunk.ChunkType.LITERAL;\r\n for (let c; (c = readNext()) != -1;) {\r\n expressionTextSB.push(c);\r\n if (isLiteral) {\r\n if (c == stopChar) {\r\n const s = sb.join(\"\");\r\n parentChunk.setText(s);\r\n return expressionTextSB.join(\"\");\r\n }\r\n sb.push(c);\r\n } else {\r\n if (isFirst && parentChunk.getType() == Chunk.ChunkType.GROUP) {\r\n switch (c) {\r\n case '*':\r\n isInSpecialGroup = true;\r\n specialGroupChar = c;\r\n break;\r\n case '?':\r\n isInSpecialGroup = true;\r\n specialGroupChar = c;\r\n break;\r\n }\r\n }\r\n isFirst = false;\r\n if (isInSpecialGroup) {\r\n if (c == ')' && lastChar == specialGroupChar) {\r\n // Mutate parent group\r\n switch (specialGroupChar) {\r\n case '*': parentChunk.setType(Chunk.ChunkType.COMMENT); break;\r\n case '?': parentChunk.setType(Chunk.ChunkType.SPECIAL_SEQUENCE); break;\r\n }\r\n let comment = sb.join(\"\");\r\n comment = comment.slice(1, comment.length - 1).trim();\r\n parentChunk.setText(comment);\r\n return expressionTextSB.join(\"\");\r\n }\r\n if (sb.length > 0 || !/\\s/.test(c)) {\r\n sb.push(c);\r\n }\r\n } else {\r\n if (c == stopChar) {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n return expressionTextSB.join(\"\");\r\n }\r\n switch (c) {\r\n case ',':\r\n case ' ':\r\n case '\\n':\r\n case '\\r':\r\n case '\\t': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n // parentChunk.addChunk(new Chunk(Chunk.ChunkType.CONCATENATION));\r\n break;\r\n }\r\n case '|': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.ALTERNATION));\r\n break;\r\n }\r\n case '*':\r\n case '+':\r\n case '?': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.REPETITION_TOKEN, c));\r\n break;\r\n }\r\n case '\\\"': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n const literalChunk = new Chunk(Chunk.ChunkType.LITERAL);\r\n const subExpressionText = loadExpression(literalChunk, readNext, '\\\"');\r\n expressionTextSB.push(subExpressionText);\r\n parentChunk.addChunk(literalChunk);\r\n break;\r\n }\r\n case '\\'': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n const literalChunk = new Chunk(Chunk.ChunkType.LITERAL);\r\n const subExpressionText = loadExpression(literalChunk, readNext, '\\'');\r\n expressionTextSB.push(subExpressionText);\r\n parentChunk.addChunk(literalChunk);\r\n break;\r\n }\r\n case '(': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n const groupChunk = new Chunk(Chunk.ChunkType.GROUP);\r\n const subExpressionText = loadExpression(groupChunk, readNext, ')');\r\n expressionTextSB.push(subExpressionText);\r\n parentChunk.addChunk(groupChunk);\r\n break;\r\n }\r\n case '[': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n const optionChunk = new Chunk(Chunk.ChunkType.OPTION);\r\n const subExpressionText = loadExpression(optionChunk, readNext, ']');\r\n expressionTextSB.push(subExpressionText);\r\n parentChunk.addChunk(optionChunk);\r\n break;\r\n }\r\n case '{': {\r\n const content = sb.join(\"\").trim();\r\n if (content.length > 0) {\r\n parentChunk.addChunk(new Chunk(Chunk.ChunkType.RULE, content));\r\n }\r\n sb.length = 0;\r\n const repetitionChunk = new Chunk(Chunk.ChunkType.REPETITION);\r\n repetitionChunk.setMinCount(0);\r\n const subExpressionText = loadExpression(repetitionChunk, readNext, '}');\r\n expressionTextSB.push(subExpressionText);\r\n parentChunk.addChunk(repetitionChunk);\r\n break;\r\n }\r\n default: {\r\n if (sb.length > 0 || !/\\s/.test(c)) {\r\n sb.push(c);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n lastChar = c;\r\n }\r\n }\r\n return expressionTextSB.join(\"\");\r\n}\r\n\r\n\r\nexport default class BNFToGrammar {\r\n\r\n /**\r\n * @param {string} text \r\n * @return {Grammar}\r\n */\r\n convert(text) {\r\n const readNext = (function () {\r\n // all your code here\r\n let index = 0;\r\n return function () {\r\n if (index < text.length) {\r\n const char = text[index];\r\n index++;\r\n return char;\r\n }\r\n return -1;\r\n };\r\n })();\r\n const sb = [];\r\n const ruleList = [];\r\n for (let c; (c = readNext()) != -1;) {\r\n switch (c) {\r\n case '=': {\r\n const chunk = new Chunk(Chunk.ChunkType.GROUP);\r\n let expressionText = loadExpression(chunk, readNext, ';');\r\n if(expressionText.endsWith(\";\")) {\r\n expressionText = expressionText.slice(0, expressionText.length - 1);\r\n }\r\n let ruleName = sb.join(\"\");\r\n sb.length = 0;\r\n if (ruleName.endsWith(\":\")) {\r\n ruleName = ruleName.slice(0, ruleName.length - 1);\r\n if (ruleName.endsWith(\":\")) {\r\n ruleName = ruleName.slice(0, ruleName.length - 1);\r\n }\r\n }\r\n ruleName = ruleName.trim();\r\n const rule = createRule(ruleName, chunk, expressionText);\r\n ruleList.push(rule);\r\n break;\r\n }\r\n // Consider that '(' in rule name is start of a comment.\r\n case '(': {\r\n if (readNext() != '*') {\r\n throw \"Expecting start of a comment after '(' but could not find '*'!\";\r\n }\r\n let lastChar = 0;\r\n for (let c2; (c2 = readNext()) != -1;) {\r\n if (c2 == ')' && lastChar == '*') {\r\n break;\r\n }\r\n lastChar = c2;\r\n }\r\n break;\r\n }\r\n default: {\r\n if (!/\\s/.test(c) || sb.length > 0) {\r\n sb.push(c);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return new Grammar(ruleList);\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/bnftogrammar.js","import Expression from './expression';\r\nimport Sequence from './sequence';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\nimport RRChoice from '../ui/rrchoice';\r\n\r\nexport default class Choice extends Expression {\r\n\r\n /**\r\n * @param {Expression | Expression[]} expressions \r\n */\r\n constructor(expressions) {\r\n super();\r\n if (arguments.length == 0) {\r\n expressions = [];\r\n } else if (expressions.constructor !== Array) {\r\n expressions = arguments;\r\n }\r\n this.expressions = expressions;\r\n }\r\n\r\n /**\r\n * @return {Expression[]}\r\n */\r\n getExpressions() {\r\n return this.expressions;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n const rrElements = [];\r\n for (let expression of this.expressions) {\r\n rrElements.push(expression.toRRElement(grammarToRRDiagram));\r\n }\r\n return new RRChoice(rrElements);\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n const expressionList = [];\r\n let hasNoop = false;\r\n for (const expression of this.expressions) {\r\n if (expression instanceof Sequence && expression.getExpressions().length == 0) {\r\n hasNoop = true;\r\n } else {\r\n expressionList.push(expression);\r\n }\r\n }\r\n if (expressionList.length == 0) {\r\n sb.push(\"( )\");\r\n } else if (hasNoop && expressionList.length == 1) {\r\n const isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\r\n if (!isUsingMultiplicationTokens) {\r\n sb.push(\"[ \");\r\n }\r\n expressionList[0].toBNF(grammarToBNF, sb, isUsingMultiplicationTokens);\r\n if (!isUsingMultiplicationTokens) {\r\n sb.push(\" ]\");\r\n }\r\n } else {\r\n const isUsingMultiplicationTokens = grammarToBNF.isUsingMultiplicationTokens;\r\n if (hasNoop && !isUsingMultiplicationTokens) {\r\n sb.push(\"[ \");\r\n } else if (hasNoop || isNested && expressionList.length > 1) {\r\n sb.push(\"( \");\r\n }\r\n const count = expressionList.length;\r\n for (let i = 0; i < count; i++) {\r\n if (i > 0) {\r\n sb.push(\" | \");\r\n }\r\n expressionList[i].toBNF(grammarToBNF, sb, false);\r\n }\r\n if (hasNoop && !isUsingMultiplicationTokens) {\r\n sb.push(\" ]\");\r\n } else if (hasNoop || isNested && expressionList.length > 1) {\r\n sb.push(\" )\");\r\n if (hasNoop) {\r\n sb.push(\"?\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof Choice)) {\r\n return false;\r\n }\r\n if(this.expressions.length != o.expressions.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < this.expressions.length; i++) {\r\n if(!this.expressions[i].equals(o.expressions[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./model/choice.js","import Expression from './expression';\r\nimport RRText from '../ui/rrtext';\r\nimport GrammarToRRDiagram from './grammartorrdiagram';\r\nimport RRElement from '../ui/rrelement';\r\nimport GrammarToBNF from './grammartobnf';\r\n\r\nexport default class SpecialSequence extends Expression {\r\n\r\n /**\r\n * @param {string} text \r\n */\r\n constructor(text) {\r\n super();\r\n this.text = text;\r\n }\r\n\r\n /**\r\n * @param {GrammarToRRDiagram} grammarToRRDiagram \r\n * @return {RRElement}\r\n */\r\n toRRElement(grammarToRRDiagram) {\r\n return new RRText(RRText.Type.SPECIAL_SEQUENCE, this.text, null);\r\n }\r\n\r\n /**\r\n * @param {GrammarToBNF} grammarToBNF \r\n * @param {string[]} sb \r\n * @param {boolean} isNested \r\n */\r\n toBNF(grammarToBNF, sb, isNested) {\r\n sb.push(\"(? \");\r\n sb.push(this.text);\r\n sb.push(\" ?)\");\r\n }\r\n\r\n /**\r\n * @param {*} o \r\n * @return {boolean}\r\n */\r\n equals(o) {\r\n if(!(o instanceof SpecialSequence)) {\r\n return false;\r\n }\r\n return this.text == o.text;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/specialsequence.js","import RRElement from './rrelement';\r\nimport LayoutInfo from './layoutinfo';\r\n\r\nexport default class RRLine extends RRElement {\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n computeLayoutInfo(rrDiagramToSVG) {\r\n this.setLayoutInfo(new LayoutInfo(0, 10, 5));\r\n }\r\n\r\n toSVG(rrDiagramToSVG, xOffset, yOffset, svgContent) {\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/rrline.js","var cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_a-number-value.js\n// module id = 116\n// module chunks = 0","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-copy-within.js\n// module id = 117\n// module chunks = 0","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-from-iterable.js\n// module id = 118\n// module chunks = 0","var aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-reduce.js\n// module id = 119\n// module chunks = 0","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_bind.js\n// module id = 120\n// module chunks = 0","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_collection-strong.js\n// module id = 121\n// module chunks = 0","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_collection-to-json.js\n// module id = 122\n// module chunks = 0","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_collection-weak.js\n// module id = 123\n// module chunks = 0","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_flatten-into-array.js\n// module id = 124\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_ie8-dom-define.js\n// module id = 125\n// module chunks = 0","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_invoke.js\n// module id = 126\n// module chunks = 0","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_is-integer.js\n// module id = 127\n// module chunks = 0","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iter-call.js\n// module id = 128\n// module chunks = 0","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_iter-step.js\n// module id = 129\n// module chunks = 0","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_math-fround.js\n// module id = 130\n// module chunks = 0","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_math-log1p.js\n// module id = 131\n// module chunks = 0","// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_math-scale.js\n// module id = 132\n// module chunks = 0","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-assign.js\n// module id = 133\n// module chunks = 0","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-dps.js\n// module id = 134\n// module chunks = 0","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-gopn-ext.js\n// module id = 135\n// module chunks = 0","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-keys-internal.js\n// module id = 136\n// module chunks = 0","var DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_object-to-array.js\n// module id = 137\n// module chunks = 0","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_own-keys.js\n// module id = 138\n// module chunks = 0","var $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_parse-float.js\n// module id = 139\n// module chunks = 0","var $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_parse-int.js\n// module id = 140\n// module chunks = 0","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_perform.js\n// module id = 141\n// module chunks = 0","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_promise-resolve.js\n// module id = 142\n// module chunks = 0","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_same-value.js\n// module id = 143\n// module chunks = 0","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_string-pad.js\n// module id = 144\n// module chunks = 0","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_to-index.js\n// module id = 145\n// module chunks = 0","exports.f = require('./_wks');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_wks-ext.js\n// module id = 146\n// module chunks = 0","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.map.js\n// module id = 147\n// module chunks = 0","'use strict';\nvar regexpExec = require('./_regexp-exec');\nrequire('./_export')({\n target: 'RegExp',\n proto: true,\n forced: regexpExec !== /./.exec\n}, {\n exec: regexpExec\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.regexp.exec.js\n// module id = 148\n// module chunks = 0","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.regexp.flags.js\n// module id = 149\n// module chunks = 0","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.set.js\n// module id = 150\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar validate = require('./_validate-collection');\nvar NATIVE_WEAK_MAP = require('./_validate-collection');\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.weak-map.js\n// module id = 151\n// module chunks = 0","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\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/webpack/buildin/global.js\n// module id = 152\n// module chunks = 0","import BNFDisplay from './bnfdisplay/BNFDisplay';\r\n\r\nimport BNFToGrammar from './model/bnftogrammar';\r\nimport Choice from './model/choice';\r\nimport Grammar from './model/grammar';\r\nimport GrammarToBNF from './model/grammartobnf';\r\nimport GrammarToRRDiagram from './model/grammartorrdiagram';\r\nimport Literal from './model/literal';\r\nimport Repetition from './model/repetition';\r\nimport Rule from './model/rule';\r\nimport RuleReference from './model/rulereference';\r\nimport Sequence from './model/sequence';\r\nimport SpecialSequence from './model/specialsequence';\r\n\r\nimport RRBreak from './ui/rrbreak';\r\nimport RRChoice from './ui/rrchoice';\r\nimport RRDiagram from './ui/rrdiagram';\r\nimport RRDiagramToSVG from './ui/rrdiagramtosvg';\r\nimport RRLine from './ui/rrline';\r\nimport RRLoop from './ui/rrloop';\r\nimport RRSequence from './ui/rrsequence';\r\nimport RRText from './ui/rrtext';\r\n\r\n\r\nexport const bnfdisplay = {\r\n BNFDisplay,\r\n}\r\n\r\nexport const model = {\r\n BNFToGrammar,\r\n Choice,\r\n Grammar,\r\n GrammarToBNF,\r\n GrammarToRRDiagram,\r\n Literal,\r\n Repetition,\r\n Rule,\r\n RuleReference,\r\n Sequence,\r\n SpecialSequence,\r\n}\r\n\r\nexport const ui = {\r\n RRBreak,\r\n RRChoice,\r\n RRDiagram,\r\n RRDiagramToSVG,\r\n RRLine,\r\n RRLoop,\r\n RRSequence,\r\n RRText,\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./main.js","\"use strict\";\n\nrequire(\"core-js/shim\");\n\nrequire(\"regenerator-runtime/runtime\");\n\nrequire(\"core-js/fn/regexp/escape\");\n\nif (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = \"defineProperty\";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, \"padLeft\", \"\".padStart);\ndefine(String.prototype, \"padRight\", \"\".padEnd);\n\n\"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\".split(\",\").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/babel-polyfill/lib/index.js\n// module id = 154\n// module chunks = 0","import BNFToGrammar from '../model/bnftogrammar';\r\nimport GrammarToRRDiagram from '../model/grammartorrdiagram';\r\nimport RRDiagramToSVG from '../ui/rrdiagramtosvg';\r\n\r\nexport default class BNFDisplay {\r\n\r\n constructor() {\r\n this.bnfToGrammar = new BNFToGrammar();\r\n this.grammarToRRDiagram = new GrammarToRRDiagram();\r\n this.grammarToRRDiagram.ruleConsideredAsLineBreak = \"\\\\\";\r\n this.rrDiagramToSVG = new RRDiagramToSVG();\r\n }\r\n\r\n /**\r\n * @return {BNFToGrammar}\r\n */\r\n getBNFToGrammar() {\r\n return this.bnfToGrammar;\r\n }\r\n\r\n /**\r\n * @return {GrammarToRRDiagram}\r\n */\r\n getGrammarToRRDiagram() {\r\n return this.grammarToRRDiagram;\r\n }\r\n\r\n /**\r\n * @return {RRDiagramToSVG}\r\n */\r\n getRRDiagramToSVG() {\r\n return this.rrDiagramToSVG;\r\n }\r\n\r\n /**\r\n * @param {string} className\r\n * @param {string} newClassName\r\n */\r\n replaceBNF(className, newClassName) {\r\n const elements = Array.from(document.getElementsByClassName(className));\r\n for (const element of elements) {\r\n if(element.tagName.toLowerCase() === 'pre') {\r\n const newElement = document.createElement('div');\r\n // Give a dummy rule definition to satisfy parser.\r\n const bnf = element.innerHTML;\r\n const grammar = this.bnfToGrammar.convert('a = ' + bnf);\r\n const rules = grammar.getRules();\r\n if(rules.length == 1) {\r\n const rule = rules[0];\r\n const rrDiagram = this.grammarToRRDiagram.convert(rule);\r\n const svg = this.rrDiagramToSVG.convert(rrDiagram);\r\n const svgContainer = document.createElement('div');\r\n svgContainer.className = newClassName;\r\n svgContainer.innerHTML = svg;\r\n newElement.appendChild(svgContainer);\r\n } else {\r\n newElement.appendChild(document.createTextNode('Error while loading BNF: ' + bnf));\r\n }\r\n element.parentElement.replaceChild(newElement, element);\r\n }\r\n }\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./bnfdisplay/BNFDisplay.js","import Sequence from './sequence';\r\nimport SpecialSequence from './specialsequence';\r\nimport Repetition from './repetition';\r\nimport RuleReference from './rulereference';\r\nimport Choice from './choice';\r\nimport Literal from './literal';\r\nimport Expression from './expression';\r\n\r\n\r\nconst ChunkType = {\r\n RULE: 'RULE',\r\n REPETITION_TOKEN: 'REPETITION_TOKEN',\r\n // CONCATENATION: 'CONCATENATION',\r\n ALTERNATION: 'ALTERNATION',\r\n GROUP: 'GROUP',\r\n COMMENT: 'COMMENT',\r\n SPECIAL_SEQUENCE: 'SPECIAL_SEQUENCE',\r\n LITERAL: 'LITERAL',\r\n OPTION: 'OPTION',\r\n REPETITION: 'REPETITION',\r\n CHOICE: 'CHOICE',\r\n};\r\n\r\n/**\r\n * @param {Expression} expression \r\n * @return {boolean}\r\n */\r\nfunction isNoop(expression) {\r\n return expression instanceof Sequence && expression.getExpressions().length == 0;\r\n}\r\n\r\nexport default class Chunk {\r\n\r\n static get ChunkType() {\r\n return ChunkType;\r\n }\r\n\r\n constructor(type, text) {\r\n this.type = type;\r\n this.text = text;\r\n this.minCount = 0;\r\n this.maxCount = null;\r\n this.chunkList = null;\r\n }\r\n\r\n getType() {\r\n return this.type;\r\n }\r\n\r\n setType(type) {\r\n this.type = type;\r\n }\r\n\r\n setText(text) {\r\n this.text = text;\r\n }\r\n\r\n setMinCount(minCount) {\r\n this.minCount = minCount;\r\n }\r\n\r\n setMaxCount(maxCount) {\r\n this.maxCount = maxCount;\r\n }\r\n\r\n addChunk(chunk) {\r\n if (this.chunkList == null) {\r\n this.chunkList = [];\r\n }\r\n this.chunkList.push(chunk);\r\n }\r\n\r\n prune() {\r\n let hasAlternation = false;\r\n for (let i = this.chunkList.length - 1; i >= 0; i--) {\r\n const chunk = this.chunkList[i];\r\n switch (chunk.getType()) {\r\n case ChunkType.REPETITION_TOKEN: {\r\n if (\"*\" === chunk.text) {\r\n this.chunkList.splice(i, 1);\r\n const previousChunk = this.chunkList[i - 1];\r\n let multiplier = null;\r\n // Case of: 3 * expression\r\n if (previousChunk.getType() == ChunkType.RULE) {\r\n multiplier = +previousChunk.text;\r\n if(isNaN(multiplier)) {\r\n multiplier = null;\r\n }\r\n }\r\n if (multiplier != null) {\r\n // The current one is removed, so next one is at index i.\r\n const nextChunk = this.chunkList[i];\r\n if (nextChunk.getType() == ChunkType.OPTION) {\r\n const newChunk = new Chunk(ChunkType.REPETITION);\r\n newChunk.setMinCount(0);\r\n newChunk.setMaxCount(multiplier);\r\n for (const c of nextChunk.chunkList) {\r\n newChunk.addChunk(c);\r\n }\r\n this.chunkList.splice(i, 1);\r\n this.chunkList[i - 1] = newChunk;\r\n } else {\r\n const newChunk = new Chunk(ChunkType.REPETITION);\r\n newChunk.setMinCount(multiplier);\r\n newChunk.setMaxCount(multiplier);\r\n newChunk.addChunk(nextChunk);\r\n this.chunkList.splice(i, 1);\r\n this.chunkList[i - 1] = newChunk;\r\n }\r\n } else {\r\n const newChunk = new Chunk(ChunkType.REPETITION);\r\n newChunk.setMinCount(0);\r\n newChunk.addChunk(previousChunk);\r\n this.chunkList[i - 1] = newChunk;\r\n }\r\n } else if (\"+\" === chunk.text) {\r\n this.chunkList.splice(i, 1);\r\n const newChunk = new Chunk(ChunkType.REPETITION);\r\n newChunk.setMinCount(1);\r\n const previousChunk = this.chunkList[i - 1];\r\n newChunk.addChunk(previousChunk);\r\n this.chunkList[i - 1] = newChunk;\r\n } else if (\"?\" === chunk.text) {\r\n this.chunkList.splice(i, 1);\r\n const newChunk = new Chunk(ChunkType.OPTION);\r\n const previousChunk = this.chunkList[i - 1];\r\n newChunk.addChunk(previousChunk);\r\n this.chunkList[i - 1] = newChunk;\r\n }\r\n break;\r\n }\r\n case ChunkType.COMMENT: {\r\n // For now, nothing to do\r\n this.chunkList.splice(i, 1);\r\n }\r\n case ChunkType.ALTERNATION: {\r\n hasAlternation = true;\r\n break;\r\n }\r\n case ChunkType.GROUP: {\r\n // Group could be empty\r\n if (chunk.chunkList != null) {\r\n chunk.prune();\r\n if (chunk.chunkList.length == 1) {\r\n this.chunkList[i] = chunk.chunkList[0];\r\n }\r\n }\r\n break;\r\n }\r\n case ChunkType.OPTION:\r\n case ChunkType.REPETITION: {\r\n chunk.prune();\r\n break;\r\n }\r\n }\r\n }\r\n if (hasAlternation) {\r\n const alternationSequenceList = [];\r\n alternationSequenceList.push([]);\r\n for (const chunk of this.chunkList) {\r\n if (chunk.getType() == ChunkType.ALTERNATION) {\r\n alternationSequenceList.push([]);\r\n } else {\r\n const list = alternationSequenceList[alternationSequenceList.length - 1];\r\n list.push(chunk);\r\n }\r\n }\r\n const choiceChunk = new Chunk(ChunkType.CHOICE);\r\n for (const subList of alternationSequenceList) {\r\n if (subList.length == 1) {\r\n choiceChunk.addChunk(subList[0]);\r\n } else {\r\n const groupChunk = new Chunk(ChunkType.GROUP);\r\n for (const c of subList) {\r\n groupChunk.addChunk(c);\r\n }\r\n choiceChunk.addChunk(groupChunk);\r\n }\r\n }\r\n this.chunkList.length = 0;\r\n this.chunkList.push(choiceChunk);\r\n }\r\n }\r\n\r\n getExpression() {\r\n switch (this.type) {\r\n case ChunkType.GROUP: {\r\n if (this.chunkList == null) {\r\n // Group is empty.\r\n return new Sequence();\r\n }\r\n if (this.chunkList.length == 1) {\r\n return this.chunkList[0].getExpression();\r\n }\r\n const expressionList = [];\r\n for (const chunk of this.chunkList) {\r\n expressionList.push(chunk.getExpression());\r\n }\r\n return new Sequence(expressionList);\r\n }\r\n case ChunkType.CHOICE: {\r\n if (this.chunkList.length == 1) {\r\n return this.chunkList[0].getExpression();\r\n }\r\n const expressionList = [];\r\n let hasLine = false;\r\n for (const chunk of this.chunkList) {\r\n let expression = chunk.getExpression();\r\n if (expression instanceof Repetition) {\r\n const repetition = expression;\r\n if (repetition.getMinRepetitionCount() == 0) {\r\n if (repetition.getMaxRepetitionCount() == null || repetition.getMaxRepetitionCount() != 1) {\r\n expression = new Repetition(repetition.getExpression(), 1, repetition.getMaxRepetitionCount());\r\n } else {\r\n expression = repetition.getExpression();\r\n }\r\n hasLine = true;\r\n }\r\n }\r\n if (expression instanceof Choice) {\r\n for (const exp of expression.getExpressions()) {\r\n expressionList.push(exp);\r\n }\r\n } else {\r\n expressionList.push(expression);\r\n }\r\n }\r\n if (hasLine && (expressionList.length == 0 || !isNoop(expressionList[expressionList.length - 1]))) {\r\n expressionList.push(new Sequence());\r\n }\r\n return new Choice(expressionList);\r\n }\r\n case ChunkType.RULE: {\r\n return new RuleReference(this.text);\r\n }\r\n case ChunkType.LITERAL: {\r\n return new Literal(this.text);\r\n }\r\n case ChunkType.SPECIAL_SEQUENCE: {\r\n return new SpecialSequence(this.text);\r\n }\r\n case ChunkType.OPTION: {\r\n if (this.chunkList.length == 1) {\r\n const subChunk = this.chunkList[0];\r\n if (subChunk.getType() == ChunkType.CHOICE) {\r\n const newChunk = new Chunk(ChunkType.CHOICE);\r\n for (const cChunk of subChunk.chunkList) {\r\n newChunk.addChunk(cChunk);\r\n }\r\n newChunk.addChunk(new Chunk(ChunkType.GROUP));\r\n return newChunk.getExpression();\r\n }\r\n return new Repetition(subChunk.getExpression(), 0, 1);\r\n }\r\n const expressionList = [];\r\n for (const chunk of this.chunkList) {\r\n expressionList.push(chunk.getExpression());\r\n }\r\n return new Repetition(new Sequence(expressionList), 0, 1);\r\n }\r\n case ChunkType.REPETITION: {\r\n if (this.chunkList.length == 1) {\r\n return new Repetition(this.chunkList[0].getExpression(), this.minCount, this.maxCount);\r\n }\r\n const expressionList = [];\r\n for (const chunk of this.chunkList) {\r\n expressionList.push(chunk.getExpression());\r\n }\r\n return new Repetition(new Sequence(expressionList), this.minCount, this.maxCount);\r\n }\r\n }\r\n throw \"Type should not be reachable: \" + this.type;\r\n }\r\n\r\n toString() {\r\n let s = \"\" + this.type;\r\n if (this.text != null) {\r\n s += \" (\" + this.text + \")\";\r\n }\r\n return s;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./model/chunk.js","import {escapeXml} from '../../utils/utils';\r\nimport SvgLine from './svgline';\r\nimport SvgPath from './svgpath';\r\n\r\nexport default class SvgContent {\r\n\r\n constructor() {\r\n this.connectorList = [];\r\n this.elements = [];\r\n }\r\n\r\n addPathConnector(x1, y1, path, x2, y2) {\r\n const c = this.connectorList.length == 0 ? null : this.connectorList[this.connectorList.length - 1];\r\n if (c != null) {\r\n if (c instanceof SvgPath) {\r\n c.addPath(new SvgPath(x1, y1, path, x2, y2));\r\n } else {\r\n const svgLine = c;\r\n const x1_ = svgLine.getX1();\r\n const y1_ = svgLine.getY1();\r\n const x2_ = svgLine.getX2();\r\n const y2_ = svgLine.getY2();\r\n if (x1_ == x2_ && x1 == x1_) {\r\n if (y2_ == y1 - 1) {\r\n svgLine.mergeLine(x1_, y1_, x2_, y2_ + 1);\r\n } else if (y1_ == y1 + 1) {\r\n svgLine.mergeLine(x1_, y1_ - 1, x2_, y2_);\r\n }\r\n } else if (y1_ == y2_ && y1 == y1_) {\r\n if (x2_ == x1 - 1) {\r\n svgLine.mergeLine(x1_, y1_, x2_ + 1, y2_);\r\n } else if (x1_ == x1 + 1) {\r\n svgLine.mergeLine(x1_ - 1, y1_, x2_, y2_);\r\n }\r\n }\r\n this.connectorList.push(new SvgPath(x1, y1, path, x2, y2));\r\n }\r\n } else {\r\n this.connectorList.push(new SvgPath(x1, y1, path, x2, y2));\r\n }\r\n }\r\n\r\n addLineConnector(x1, y1, x2, y2) {\r\n const x1_ = Math.min(x1, x2);\r\n const y1_ = Math.min(y1, y2);\r\n const x2_ = Math.max(x1, x2);\r\n const y2_ = Math.max(y1, y2);\r\n const c = this.connectorList.length == 0 ? null : this.connectorList[this.connectorList.length - 1];\r\n if (c == null || !(c instanceof SvgLine) || !c.mergeLine(x1_, y1_, x2_, y2_)) {\r\n this.connectorList.push(new SvgLine(x1_, y1_, x2_, y2_));\r\n }\r\n }\r\n\r\n getConnectorElement(rrDiagramToSVG) {\r\n if (this.connectorList.length == 0) {\r\n return \"\";\r\n }\r\n let path0 = null;\r\n for (let connector of this.connectorList) {\r\n if (path0 == null) {\r\n if (connector instanceof SvgPath) {\r\n path0 = connector;\r\n } else {\r\n const svgLine = connector;\r\n const x1 = svgLine.getX1();\r\n const y1 = svgLine.getY1();\r\n path0 = new SvgPath(x1, y1, \"M\" + x1 + (y1 < 0 ? y1 : \" \" + y1), x1, y1);\r\n path0.addLine(svgLine);\r\n }\r\n } else {\r\n if(connector instanceof SvgPath) {\r\n path0.addPath(connector);\r\n } else {\r\n path0.addLine(connector);\r\n }\r\n }\r\n }\r\n return \"<path class=\\\"\" + escapeXml(rrDiagramToSVG.cssConnectorClass) + \"\\\" d=\\\"\" + path0.getPath() + \"\\\"/>\";\r\n }\r\n\r\n addElement(element) {\r\n this.elements.push(element);\r\n }\r\n\r\n getElements() {\r\n return this.elements;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./ui/svg/svgcontent.js","export default class svgline {\r\n\r\n constructor(x1, y1, x2, y2) {\r\n this.x1 = x1;\r\n this.y1 = y1;\r\n this.x2 = x2;\r\n this.y2 = y2;\r\n }\r\n\r\n getX1() {\r\n return this.x1;\r\n }\r\n\r\n getY1() {\r\n return this.y1;\r\n }\r\n\r\n getX2() {\r\n return this.x2;\r\n }\r\n\r\n getY2() {\r\n return this.y2;\r\n }\r\n\r\n mergeLine(x1, y1, x2, y2) {\r\n if (x1 == x2 && this.x1 == this.x2 && x1 == this.x1) {\r\n if (y2 >= this.y1 - 1 && y1 <= this.y2 + 1) {\r\n this.y1 = Math.min(this.y1, y1);\r\n this.y2 = Math.max(this.y2, y2);\r\n return true;\r\n }\r\n } else if (y1 == y2 && this.y1 == this.y2 && y1 == this.y1) {\r\n if (x2 >= this.x1 - 1 && x1 <= this.x2 + 1) {\r\n this.x1 = Math.min(this.x1, x1);\r\n this.x2 = Math.max(this.x2, x2);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/svg/svgline.js","export default class SvgPath {\r\n\r\n constructor(startX, startY, path, endX, endY) {\r\n this.pathSB = [];\r\n this.startX = startX;\r\n this.startY = startY;\r\n this.pathSB.push(path);\r\n this.endX = endX;\r\n this.endY = endY;\r\n }\r\n\r\n addPath(svgPath) {\r\n const x1 = svgPath.startX;\r\n const y1 = svgPath.startY;\r\n const path = svgPath.getPath();\r\n const x2 = svgPath.endX;\r\n const y2 = svgPath.endY;\r\n if (x1 != this.endX || y1 != this.endY) {\r\n if (x1 == this.endX && y1 == this.endY + 1) {\r\n this.pathSB.push(\"v\", y1 - y2);\r\n } else if (y1 == this.endY && x1 == this.endX + 1) {\r\n this.pathSB.push(\"h\", x1 - x2);\r\n } else {\r\n this.pathSB.push(\"m\", x1 - this.endX);\r\n if (y1 - this.endY >= 0) {\r\n this.pathSB.push(\" \");\r\n }\r\n this.pathSB.push(y1 - this.endY);\r\n }\r\n }\r\n this.pathSB.push(path);\r\n this.endX = x2;\r\n this.endY = y2;\r\n }\r\n\r\n addLine(svgLine) {\r\n const x1 = svgLine.getX1();\r\n const y1 = svgLine.getY1();\r\n const x2 = svgLine.getX2();\r\n const y2 = svgLine.getY2();\r\n if (x1 == x2 && this.endX == x1) {\r\n if (this.endY == y1 || this.endY == y1 - 1) {\r\n this.pathSB.push(\"v\", y2 - this.endY);\r\n this.endY = y2;\r\n return;\r\n }\r\n if (this.endY == y2 || this.endY == y2 + 1) {\r\n this.pathSB.push(\"v\", y1 - this.endY);\r\n this.endY = y1;\r\n return;\r\n }\r\n } else if (y1 == y2 && this.endY == y1) {\r\n if (this.endX == x1 || this.endX == x1 - 1) {\r\n this.pathSB.push(\"h\", x2 - this.endX);\r\n this.endX = x2;\r\n return;\r\n }\r\n if (this.endX == x2 || this.endX == x2 + 1) {\r\n this.pathSB.push(\"h\", x1 - this.endX);\r\n this.endX = x1;\r\n return;\r\n }\r\n }\r\n this.pathSB.push(\"m\", x1 - this.endX);\r\n if (y1 - this.endY >= 0) {\r\n this.pathSB.push(\" \");\r\n }\r\n this.pathSB.push(y1 - this.endY);\r\n if (x1 == x2) {\r\n this.pathSB.push(\"v\", y2 - y1);\r\n } else if (y1 == y2) {\r\n this.pathSB.push(\"h\", x2 - x1);\r\n } else {\r\n this.pathSB.push(\"l\", x2 - x1);\r\n if (y2 - y1 >= 0) {\r\n this.pathSB.push(\" \");\r\n }\r\n this.pathSB.push(y2 - y1);\r\n }\r\n this.endX = x2;\r\n this.endY = y2;\r\n }\r\n\r\n getPath() {\r\n return this.pathSB.join(\"\");\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./ui/svg/svgpath.js","require('../../modules/core.regexp.escape');\nmodule.exports = require('../../modules/_core').RegExp.escape;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/fn/regexp/escape.js\n// module id = 160\n// module chunks = 0","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_array-species-constructor.js\n// module id = 161\n// module chunks = 0","'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_date-to-iso-string.js\n// module id = 162\n// module chunks = 0","'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_date-to-primitive.js\n// module id = 163\n// module chunks = 0","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_enum-keys.js\n// module id = 164\n// module chunks = 0","module.exports = require('./_shared')('native-function-to-string', Function.toString);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_function-to-string.js\n// module id = 165\n// module chunks = 0","module.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/_replacer.js\n// module id = 166\n// module chunks = 0","// https://github.com/benjamingr/RexExp.escape\nvar $export = require('./_export');\nvar $re = require('./_replacer')(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/core.regexp.escape.js\n// module id = 167\n// module chunks = 0","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.copy-within.js\n// module id = 168\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.every.js\n// module id = 169\n// module chunks = 0","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.fill.js\n// module id = 170\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.filter.js\n// module id = 171\n// module chunks = 0","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.find-index.js\n// module id = 172\n// module chunks = 0","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.find.js\n// module id = 173\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.for-each.js\n// module id = 174\n// module chunks = 0","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.from.js\n// module id = 175\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.index-of.js\n// module id = 176\n// module chunks = 0","// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.is-array.js\n// module id = 177\n// module chunks = 0","'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.join.js\n// module id = 178\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.last-index-of.js\n// module id = 179\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.map.js\n// module id = 180\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.of.js\n// module id = 181\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.reduce-right.js\n// module id = 182\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.reduce.js\n// module id = 183\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.slice.js\n// module id = 184\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.some.js\n// module id = 185\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.sort.js\n// module id = 186\n// module chunks = 0","require('./_set-species')('Array');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.array.species.js\n// module id = 187\n// module chunks = 0","// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.date.now.js\n// module id = 188\n// module chunks = 0","// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js/modules/es6.date.to-iso-string.js\n// module id = 189\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/core-js (…)
[all...]
/plugin/dirtylittlehelper/script/
H A Dmermaid.min.js1pv,u:ev,U:nv,V:rv,w:tv,W:iv,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,… function
/plugin/diagramsnet/lib/js/mermaid/
H A Dmermaid.min.js6pv,u:ev,U:nv,V:rv,w:tv,W:iv,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,… function
/plugin/mermaid/
H A Dmermaid.min.js338 You have to call mermaid.initialize.`)},"addSingleLink"),wCe=o(function(t,e,r){V.info("addLink",t,e,r);for(let n of t)for(let i of e)bCe(n,i,r)},"addLink"),TCe=o(function(t,e){t.forEach(function(r){r==="default"?Es.defaultInterpolate=e:Es[r].interpolate=e})},"updateLinkInterpolate"),kCe=o(function(t,e){t.forEach(function(r){if(typeof r=="number"&&r>=Es.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${Es.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?Es.defaultStyle=e:(Es[r].style=e,(Es[r]?.style?.length??0)>0&&!Es[r]?.style?.some(n=>n?.startsWith("fill"))&&Es[r]?.style?.push("fill:none"))})},"updateLink"),ECe=o(function(t,e){t.split(",").forEach(function(r){let n=dv.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},dv.set(r,n)),e?.forEach(function(i){if(/color/.exec(i)){let a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)})})},"addClass"),CCe=o(function(t){Fo=t,/.*</.exec(Fo)&&(Fo="RL"),/.*\^/.exec(Fo)&&(Fo="BT"),/.*>/.exec(Fo)&&(Fo="LR"),/.*v/.exec(Fo)&&(Fo="TB"),Fo==="TD"&&(Fo="TB")},"setDirection"),u9=o(function(t,e){for(let r of t.split(",")){let n=$h.get(r);n&&n.classes.push(e);let i=l9.get(r);i&&i.classes.push(e)}},"setClass"),SCe=o(function(t,e){if(e!==void 0){e=C5(e);for(let r of t.split(","))c9.set(k5==="gen-1"?S5(r):r,e)}},"setTooltip"),ACe=o(function(t,e,r){let n=S5(t);if(de().securityLevel!=="loose"||e===void 0)return;let i=[];if(typeof r=="string"){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s<i.length;s++){let l=i[s].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),i[s]=l}}i.length===0&&i.push(t);let a=$h.get(t);a&&(a.haveCallback=!0,E5.push(function(){let s=document.querySelector(`[id="${n}"]`);s!==null&&s.addEventListener("click",function(){Lt.runFunc(e,...i)},!1)}))},"setClickFun"),_Ce=o(function(t,e,r){t.split(",").forEach(function(n){let i=$h.get(n);i!==void 0&&(i.link=Lt.formatUrl(e,cm),i.linkTarget=r)}),u9(t,"clickable")},"setLink"),GX=o(function(t){return c9.get(t)},"getTooltip"),LCe=o(function(t,e,r){t.split(",").forEach(function(n){ACe(n,e,r)}),u9(t,"clickable")},"setClickEvent"),DCe=o(function(t){E5.forEach(function(e){e(t)})},"bindFunctions"),h9=o(function(){return Fo.trim()},"getDirection"),$X=o(function(){return $h},"getVertices"),VX=o(function(){return Es},"getEdges"),RCe=o(function(){return dv},"getClasses"),UX=o(function(t){let e=$e(".mermaidTooltip");(e._groups||e)[0][0]===null&&(e=$e("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),$e(t).select("svg").selectAll("g.node").on("mouseover",function(){let i=$e(this);if(i.attr("title")===null)return;let s=this?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(i.attr("title")).style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),i.classed("hover",!0)}).on("mouseout",function(){e.transition().duration(500).style("opacity",0),$e(this).classed("hover",!1)})},"setupToolTips");E5.push(UX);NCe=o(function(t="gen-1"){$h=new Map,dv=new Map,Es=[],E5=[UX],Cu=[],l9=new Map,T5=0,c9=new Map,s9=!0,k5=t,cm=de(),vr()},"clear"),MCe=o(t=>{k5=t||"gen-2"},"setGen"),ICe=o(function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},"defaultStyle"),OCe=o(function(t,e,r){let n=t.text.trim(),i=r.text;t===r&&/\s/.exec(r.text)&&(n=void 0);function a(h){let f={boolean:{},number:{},string:{}},d=[],p;return{nodeList:h.filter(function(g){let y=typeof g;return g.stmt&&g.stmt==="dir"?(p=g.value,!1):g.trim()===""?!1:y in f?f[y].hasOwnProperty(g)?!1:f[y][g]=!0:d.includes(g)?!1:d.push(g)}),dir:p}}o(a,"uniq");let{nodeList:s,dir:l}=a(e.flat());if(k5==="gen-1")for(let h=0;h<s.length;h++)s[h]=S5(s[h]);n=n??"subGraph"+T5,i=i||"",i=C5(i),T5=T5+1;let u={id:n,nodes:s,title:i.trim(),classes:[],dir:l,labelType:r.type};return V.info("Adding",u.id,u.nodes,u.dir),u.nodes=XX(u,Cu).nodes,Cu.push(u),l9.set(n,u),n},"addSubGraph"),PCe=o(function(t){for(let[e,r]of Cu.entries())if(r.id===t)return e;return-1},"getPosForId"),fv=-1,HX=[],YX=o(function(t,e){let r=Cu[e].nodes;if(fv=fv+1,fv>2e3)return{result:!1,count:0};if(HX[fv]=e,Cu[e].id===t)return{result:!0,count:0};let n=0,i=1;for(;n<r.length;){let a=PCe(r[n]);if(a>=0){let s=YX(t,a);if(s.result)return{result:!0,count:i+s.count};i=i+s.count}n=n+1}return{result:!1,count:i}},"indexNodes2"),BCe=o(function(t){return HX[t]},"getDepthFirstPos"),FCe=o(function(){fv=-1,Cu.length>0&&YX("none",Cu.length-1)},"indexNodes"),WX=o(function(){return Cu},"getSubGraphs"),zCe=o(()=>s9?(s9=!1,!0):!1,"firstGraph"),GCe=o(t=>{let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1);break}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}},"destructStartLink"),$Ce=o((t,e)=>{let r=e.length,n=0;for(let i=0;i<r;++i)e[i]===t&&++n;return n},"countChar"),VCe=o(t=>{let e=t.trim(),r=e.slice(0,-1),n="arrow_open";switch(e.slice(-1)){case"x":n="arrow_cross",e.startsWith("x")&&(n="double_"+n,r=r.slice(1));break;case">":n="arrow_point",e.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e.startsWith("o")&&(n="double_"+n,r=r.slice(1));break}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");let s=$Ce(".",r);return s&&(i="dotted",a=s),{type:n,stroke:i,length:a}},"destructEndLink"),UCe=o((t,e)=>{let r=VCe(t),n;if(e){if(n=GCe(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=r.length,n}return r},"destructLink"),qX=o((t,e)=>{for(let r of t)if(r.nodes.includes(e))return!0;return!1},"exists"),XX=o((t,e)=>{let r=[];return t.nodes.forEach((n,i)=>{qX(e,n)||r.push(t.nodes[i])}),{nodes:r}},"makeUniq"),HCe={firstGraph:zCe},YCe=o(t=>t.type==="square"?"squareRect":t.type==="round"?"roundedRect":t.type??"squareRect","getTypeFromVertex"),WCe=o((t,e)=>t.find(r=>r.id===e),"findNode"),qCe=o(t=>{let e="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),r=e;break}return{arrowTypeStart:e,arrowTypeEnd:r}},"destructEdgeType"),XCe=o((t,e,r,n,i,a)=>{let s=r.get(t.id),l=n.get(t.id)??!1,u=WCe(e,t.id);u?(u.cssStyles=t.styles,u.cssCompiledStyles=o9(t.classes),u.cssClasses=t.classes.join(" ")):e.push({id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:o9(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),shape:YCe(t),dir:t.dir,domId:t.domId,isGroup:l,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:GX(t.id)})},"addNodeFromVertex");o(o9,"getCompiledStyles");jCe=o(()=>{let t=de(),e=[],r=[],n=WX(),i=new Map,a=new Map;for(let u=n.length-1;u>=0;u--){let h=n[u];h.nodes.length>0&&a.set(h.id,!0);for(let f of h.nodes)i.set(f,h.id)}for(let u=n.length-1;u>=0;u--){let h=n[u];e.push({id:h.id,label:h.title,labelStyle:"",parentId:i.get(h.id),padding:8,cssCompiledStyles:o9(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:t.look})}$X().forEach(u=>{XCe(u,e,i,a,t,t.look||"classic")});let l=VX();return l.forEach((u,h)=>{let{arrowTypeStart:f,arrowTypeEnd:d}=qCe(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);let m={id:y5(u.start,u.end,{counter:h,prefix:"L"}),start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:u?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:u?.stroke==="invisible"?"none":f,arrowTypeEnd:u?.stroke==="invisible"?"none":d,arrowheadStyle:"fill: #333",labelStyle:p,style:p,pattern:u.stroke,look:t.look};r.push(m)}),{nodes:e,edges:r,other:{},config:t}},"getData"),A5={defaultConfig:o(()=>_4.flowchart,"defaultConfig"),setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,getData:jCe,setAccDescription:_r,addVertex:xCe,lookUpDomId:S5,addLink:wCe,updateLinkInterpolate:TCe,updateLink:kCe,addClass:ECe,setDirection:CCe,setClass:u9,setTooltip:SCe,getTooltip:GX,setClickEvent:LCe,setLink:_Ce,bindFunctions:DCe,getDirection:h9,getVertices:$X,getEdges:VX,getClasses:RCe,clear:NCe,setGen:MCe,defaultStyle:ICe,addSubGraph:OCe,getDepthFirstPos:BCe,indexNodes:FCe,getSubGraphs:WX,destructLink:UCe,lex:HCe,exists:qX,makeUniq:XX,setDiagramTitle:nn,getDiagramTitle:Xr}});var KCe,jX,KX=R(()=>{"use strict";KCe=o(t=>{let e=new Set;for(let r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),jX=o((t,e,r)=>{let n=KCe(t),i=2,a=e.height+2*r.padding,s=a/i,l=e.width+2*s+r.padding,u=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:l/2,y:2*u},{x:l-s,y:0},{x:l,y:0},{x:l,y:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-s,y:-a},{x:l/2,y:-a-2*u},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:s,y:0},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:l-s,y:-a},{x:l,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:l,y:-s},{x:l,y:-a+s},{x:0,y:-a}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:l,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:l,y:-a}]:n.has("right")&&n.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")&&n.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:l,y:-s},{x:0,y:-a}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]:n.has("left")&&n.has("up")?[{x:l,y:0},{x:0,y:-s},{x:l,y:-a}]:n.has("left")&&n.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]:n.has("right")?[{x:s,y:-u},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a+u}]:n.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")?[{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u}]:n.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints")});function m9(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function rj(t){Sd=t}function ro(t,e){if(e){if(nj.test(t))return t.replace(QCe,QX)}else if(ij.test(t))return t.replace(ZCe,QX);return t}function t7e(t){return t.replace(e7e,(e,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}function ln(t,e){let r=typeof t=="string"?t:t.source;e=e||"";let n={replace:o((i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(r7e,"$1"),r=r.replace(i,s),n},"replace"),getRegex:o(()=>new RegExp(r,e),"getRegex")};return n}function ZX(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}function JX(t,e){let r=t.replace(/\|/g,(a,s,l)=>{let u=!1,h=s;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(/ \|/),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function pv(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n;){let a=t.charAt(n-i-1);if(a===e&&!r)i++;else if(a!==e&&r)i++;else break}return t.slice(0,n-i)}function n7e(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return-1}function ej(t,e,r,n){let i=e.href,a=e.title?ro(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){n.state.inLink=!0;let l={type:"link",raw:r,href:i,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}return{type:"image",raw:r,href:i,title:a,text:ro(s)}}function i7e(t,e){let r=t.match(/^(\s+)(?:```)/);if(r===null)return e;let n=r[1];return e.split(`
340 `)}function jr(t,e){return Cd.parse(t,e)}var Sd,nj,QCe,ij,ZCe,JCe,QX,e7e,r7e,gv,hm,a7e,s7e,o7e,vv,l7e,aj,sj,g9,c7e,y9,u7e,h7e,D5,v9,f7e,oj,d7e,x9,tj,p7e,m7e,lj,g7e,cj,y7e,xv,v7e,x7e,b7e,w7e,T7e,k7e,E7e,C7e,S7e,L5,A7e,uj,hj,_7e,b9,L7e,d9,D7e,_5,mv,Su,fm,yv,Au,um,p9,Cd,mkt,gkt,ykt,vkt,xkt,bkt,wkt,fj=R(()=>{"use strict";o(m9,"_getDefaults");Sd=m9();o(rj,"changeDefaults");nj=/[&<>"']/,QCe=new RegExp(nj.source,"g"),ij=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ZCe=new RegExp(ij.source,"g"),JCe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},QX=o(t=>JCe[t],"getEscapeReplacement");o(ro,"escape$1");e7e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;o(t7e,"unescape");r7e=/(^|[^\[])\^/g;o(ln,"edit");o(ZX,"cleanUrl");gv={exec:o(()=>null,"exec")};o(JX,"splitCells");o(pv,"rtrim");o(n7e,"findClosingBracket");o(ej,"outputLink");o(i7e,"indentCodeCompensation");hm=class{static{o(this,"_Tokenizer")}options;rules;lexer;constructor(e){this.options=e||Sd}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pv(n,`
341 `)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=i7e(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(/#$/.test(n)){let i=pv(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:pv(r[0],`
342 `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=pv(r[0],`
362 `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:ro(r[1])}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let s=pv(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=n7e(r[2],"()");if(s>-1){let u=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,u).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ej(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(/\s+/g," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ej(n,a,n[0],this.lexer)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,l,u,h=s,f=0,d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*e.length+s);(i=d.exec(r))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(u=[...l].length,i[3]||i[4]){h+=u;continue}else if((i[5]||i[6])&&s%3&&!((s+u)%3)){f+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let p=[...i[0]][0].length,m=e.slice(0,s+i.index+p+u);if(Math.min(s,u)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(/\n/g," "),i=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return i&&a&&(n=n.substring(1,n.length-1)),n=ro(n,!0),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=ro(r[1]),i="mailto:"+n):(n=ro(r[1]),i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let r;if(r=this.rules.inline.url.exec(e)){let n,i;if(r[2]==="@")n=ro(r[0]),i="mailto:"+n;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(a!==r[0]);n=ro(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=ro(r[0]),{type:"text",raw:r[0],text:n}}}},a7e=/^(?: *(?:\n|$))+/,s7e=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,o7e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l7e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,aj=/(?:[*+-]|\d{1,9}[.)])/,sj=ln(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,aj).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),g9=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c7e=/^[^\n]+/,y9=/(?!\s*\])(?:\\.|[^\[\]\\])+/,u7e=ln(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",y9).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),h7e=ln(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,aj).getRegex(),D5="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",v9=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,f7e=ln("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",v9).replace("tag",D5).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oj=ln(g9).replace("hr",vv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D5).getRegex(),d7e=ln(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oj).getRegex(),x9={blockquote:d7e,code:s7e,def:u7e,fences:o7e,heading:l7e,hr:vv,html:f7e,lheading:sj,list:h7e,newline:a7e,paragraph:oj,table:gv,text:c7e},tj=ln("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D5).getRegex(),p7e={...x9,table:tj,paragraph:ln(g9).replace("hr",vv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tj).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D5).getRegex()},m7e={...x9,html:ln(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",v9).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ln(g9).replace("hr",vv).replace("heading",` *#{1,6} *[^
1323 `);const m=Oe().securityLevel;let b;m==="sandbox"&&(b=Mr("#i"+a));const E=Mr(m==="sandbox"?b.nodes()[0].contentDocument.body:"body");nv.init();const C=E.select("#"+a);RP.initGraphi global() class in AnonymousFunction3478d9c75cb00.AnonymousFunction3478d9c75dd00
[all...]
/plugin/bpmnio/vendor/dmn-js/dist/
H A Ddmn-modeler.production.min.js191 `,this._current.container)},nd.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:o,headerEntries:r,emptyPlaceholder:s}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:o,headerEntries:r,emptyPlaceholder:s,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},nd.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:o}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:o},this._emit("refresh"),this._render()},nd.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),o=this._getHeaderEntries(e,n);return{entries:i,headerEntries:o,emptyPlaceholder:this._getEmptyPlaceholder(n),empty:!(Object.keys(i).length||Object.keys(o).length)}},nd.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},nd.prototype.reset=function(){const e=this._current.container;mh(null,e),en(e)},nd.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},nd.prototype._onOpened=function(){this._emit("opened")},nd.prototype._onClosed=function(){this._emit("closed")},nd.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=Gt(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return t.appendChild(n),n},nd.prototype._bindAutoClose=function(){this._eventBus.once(td,this.close,this)},nd.prototype._unbindAutoClose=function(){this._eventBus.off(td,this.close,this)},nd.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),o=this._config.scale,r=n;return!0!==o&&(!1===o?(e=1,t=1):(e=o.min,t=o.max),i(e)&&n<e&&(r=e),i(t)&&n>t&&(r=t)),r},nd.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),o={},r=t.x,s=t.y;return t.x+i.width>n.width&&(o.x=!0),t.y+i.height>n.height&&(o.y=!0),o.x&&o.y?(r=t.x-i.width,s=t.y-i.height):o.x?(r=t.x-i.width,s=t.y):o.y&&t.y<i.height?(r=t.x,s=10):o.y&&(r=t.x,s=t.y-i.height),t.y<n.top&&(s=t.y+i.height),{x:r,y:s}},nd.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length||this._getContext(e,t).empty},nd.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},nd.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},nd.prototype._getEntries=function(e,t){var n={};return p(t,(function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);l(i)?n=i(n):p(i,(function(e,t){n[t]=e}))}else p(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=P(e,["id"])}))})),n},nd.prototype._getHeaderEntries=function(e,t){var n={};return p(t,(function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);l(i)?n=i(n):p(i,(function(e,t){n[t]=e}))}else{if(!t.getHeaderEntries)return;p(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=P(e,["id"])}))}})),n},nd.prototype._getEmptyPlaceholder=function(e){const t=e.find((e=>l(e.getEmptyPlaceholder)));return t&&t.getEmptyPlaceholder()},nd.prototype.isOpen=function(){return!!this._current},nd.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let n=Pt(Bt(e.delegateTarget||e.target,".entry",!0),"data-id");t={id:n,...this._getEntry(n)}}const i=t.action;if(!1!==this._emit("trigger",{entry:t,event:e}))if(l(i)){if("click"===n)return i(e,t)}else if(i[n])return i[n](e,t)},nd.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};var ad={search:["value",function(e,t,n){const{keys:i}=n,o=t.trim().toLowerCase().split(/\s+/);return e.flatMap((e=>{const t=function(e,t,n){const{matchedWords:i,tokens:o}=n.reduce(((n,i)=>{const o=e[i],{tokens:r,matchedWords:s}=function(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],i={},o=t.map(sd).flatMap((e=>["(?<wordStart>\\b"+e+")",e])).join("|"),r=new RegExp(o,"ig");let s,a=0;for(;s=r.exec(e);){const[t]=s;s.index>a&&n.push({value:e.slice(a,s.index),index:a}),n.push({value:t,index:s.index,match:!0,wordStart:!!s.groups.wordStart,start:0===s.index}),i[t.toLowerCase()]=!0,a=s.index+t.length}a<e.length&&n.push({value:e.slice(a),index:a});return{tokens:n,matchedWords:i}}(o,t);return{tokens:{...n.tokens,[i]:r},matchedWords:{...n.matchedWords,...s}}}),{matchedWords:{},tokens:{}});if(Object.keys(i).length!==t.length)return null;return o}(e,o,i);return t?{item:e,tokens:t}:[]})).sort(function(e){return(t,n)=>{for(const i of e){const e=id(t.tokens[i],n.tokens[i]);if(0!==e)return e;const o=rd(t.item[i],n.item[i]);if(0!==o)return o}return 0}}(i))}]},ld={__depends__:[ad],__init__:["popupMenu"],popupMenu:["type",nd]},cd=Math.round;function ud(e,t){this._modeling=e,this._eventBus=t}function hd(e,t){t.on("replace.end",500,(function(t){const{newElement:n,hints:i={}}=t;!1!==i.select&&e.select(n)}))}ud.$inject=["modeling","eventBus"],ud.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,o=this._eventBus;o.fire("replace.start",{element:e,attrs:t,hints:n});var r=t.width||e.width,s=t.height||e.height,a=t.x||e.x,l=t.y||e.y,c=cd(a+r/2),u=cd(l+s/2),h=i.replaceShape(e,M({},t,{x:c,y:u,width:r,height:s}),n);return o.fire("replace.end",{element:e,newElement:h,hints:n}),h},hd.$inject=["selection","eventBus"];var dd={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",hd],replace:["type",ud]};function pd(e,t,n,i){this.replaceElement=function(n,i,o){o=o||{};var r=i.type,s=n.businessObject,a=e.create(r),l={type:r,businessObject:a};if(l.width=n.width,l.height=n.height,a.name=s.name,i.table){var c=e.create("dmn:DecisionTable");c.$parent=a;var u=e.create("dmn:OutputClause");u.typeRef="string",u.$parent=c,c.output=[u];var h=e.create("dmn:InputClause");h.$parent=c;var d=e.create("dmn:LiteralExpression",{typeRef:"string"});h.inputExpression=d,d.$parent=h,c.input=[h],fd(a,c,e)}if(i.expression){var p=e.create("dmn:LiteralExpression"),f=e.create("dmn:InformationItem",{name:s.name});fd(a,p,e,f)}return t.replaceElement(n,l,o)}}function fd(e,t,n,i){if(hn(e,"dmn:Decision"))e.decisionLogic=t,t.$parent=e;else if(hn(e,"dmn:BusinessKnowledgeModel")){var o=n.create("dmn:FunctionDefinition",{body:t});e.encapsulatedLogic=o,o.$parent=e,t.$parent=o}i&&(e.variable=i,i.$parent=e)}pd.$inject=["drdFactory","replace","selection","modeling"];var gd={__depends__:[dd,Aa],drdReplace:["type",pd]},md=[{label:"Empty",actionName:"replace-with-empty-decision",className:"dmn-icon-clear",target:{type:"dmn:Decision",table:!1,expression:!1}},{label:"Decision table",actionName:"replace-with-decision-table",className:"dmn-icon-decision-table",target:{type:"dmn:Decision",table:!0,expression:!1}},{label:"Literal expression",actionName:"replace-with-literal-expression",className:"dmn-icon-literal-expression",target:{type:"dmn:Decision",table:!1,expression:!0}}],vd=[{label:"Empty",actionName:"replace-with-empty",className:"dmn-icon-clear",target:{type:"dmn:BusinessKnowledgeModel",table:!1,expression:!1}},{label:"Literal Expression",actionName:"replace-with-literal-expression",className:"dmn-icon-literal-expression",target:{type:"dmn:BusinessKnowledgeModel",table:!1,expression:!0}}];function yd(e,t,n,i,o,r){this._popupMenu=e,this._modeling=t,this._moddle=n,this._drdReplace=i,this._rules=o,this._translate=r,this.register()}yd.$inject=["popupMenu","modeling","moddle","drdReplace","rules","translate"],yd.prototype.register=function(){this._popupMenu.registerProvider("dmn-replace",this)},yd.prototype.getEntries=function(e){var t,n,i=e.businessObject;return this._rules.allowed("shape.replace",{element:e})?hn(i,"dmn:Decision")?(n=mn(i),t=d(md,(function(e){var t="replace-with-empty-decision"===e.actionName&&n,i="replace-with-decision-table"===e.actionName&&!hn(n,"dmn:DecisionTable"),o="replace-with-literal-expression"===e.actionName&&!hn(n,"dmn:LiteralExpression");return t||i||o})),this._createEntries(e,t)):hn(i,"dmn:BusinessKnowledgeModel")?(n=mn(i),t=d(vd,(function(e){var t="replace-with-empty"===e.actionName&&n,i="replace-with-decision-table"===e.actionName&&!hn(n,"dmn:DecisionTable"),o="replace-with-literal-expression"===e.actionName&&!hn(n,"dmn:LiteralExpression");return t||i||o})),this._createEntries(e,t)):[]:[]},yd.prototype._createEntries=function(e,t){var n=[],i=this;return p(t,(function(t){var o=i._createMenuEntry(t,e);n.push(o)})),n},yd.prototype._createMenuEntry=function(e,t,n){var i=this._drdReplace.replaceElement;return n=n||function(){return i(t,e.target)},{label:(0,this._translate)(e.label),className:e.className,id:e.actionName,action:n}},yd.prototype.getHeaderEntries=function(e){return[]};var xd={__depends__:[ha,ld,gd],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",yd]};function bd(e,t,n,i,o,r,s,a,l,c,u,h){u=u||{},t.registerProvider(this),this._contextPad=t,this._modeling=n,this._elementFactory=i,this._connect=o,this._create=r,this._rules=s,this._popupMenu=a,this._canvas=l,this._translate=c,!1!==u.autoPlace&&(this._autoPlace=h.get("autoPlace",!1)),e.on("create.end",250,(function(e){var n=e.context.shape;if(xa(e)){var i=t.getEntries(n);i.replace&&i.replace.action.click(e,n)}}))}bd.$inject=["eventBus","contextPad","modeling","elementFactory","connect","create","rules","popupMenu","canvas","translate","config.contextPad","injector"],bd.prototype.getContextPadEntries=function(e){var t=this._modeling,n=this._elementFactory,i=this._connect,o=this._create,s=this._popupMenu,a=this._contextPad,l=this._rules,c=this._translate,u=this._autoPlace,h={};if("label"===e.type)return h;var d=e.businessObject;function p(e,t,n){i.start(e,t,n)}function f(e,t,i,r){function s(t,i){var s=n.createShape(M({type:e},r));o.start(t,s,{source:i,hints:{connectionTarget:i}})}var a=u?function(t,i){var o=n.createShape(M({type:e},r));u.append(i,o,{connectionTarget:i})}:s;return{group:"model",className:t,title:i,action:{dragstart:s,click:a}}}hn(d,"dmn:Decision")&&M(h,{"append.decision":f("dmn:Decision","dmn-icon-decision",c("Append decision"))}),gn(d,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])&&M(h,{"append.knowledge-source":f("dmn:KnowledgeSource","dmn-icon-knowledge-source",c("Append knowledge source"))}),gn(d,["dmn:BusinessKnowledgeModel","dmn:Decision"])&&M(h,{"append.business-knowledge-model":f("dmn:BusinessKnowledgeModel","dmn-icon-business-knowledge",c("Append business knowledge model"))}),gn(d,["dmn:Decision","dmn:KnowledgeSource"])&&M(h,{"append.input-data":f("dmn:InputData","dmn-icon-input-data",c("Append input data"))}),hn(d,"dmn:DRGElement")&&M(h,{"append.text-annotation":f("dmn:TextAnnotation","dmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"dmn-icon-connection-multi",title:c("Connect to other element"),action:{click:p,dragstart:p}}}),hn(d,"dmn:TextAnnotation")&&M(h,{connect:{group:"connect",className:"dmn-icon-connection-multi",title:c("Connect to other element"),action:{click:p,dragstart:p}}}),s.isEmpty(e,"dmn-replace")||M(h,{replace:{group:"edit",className:"dmn-icon-screw-wrench",title:c("Change type"),action:{click:function(e,t){var n=M(function(e){var t=a.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}}(t),{cursor:{x:e.x,y:e.y}});s.open(t,"dmn-replace",n)}}}});var g=l.allowed("elements.delete",{elements:[e]});return r(g)&&(g=g[0]===e),g&&M(h,{delete:{group:"edit",className:"dmn-icon-trash",title:c("Delete"),action:{click:function(n){t.removeElements([e])}}}}),h};var _d={__depends__:[ha,du,Aa,yu,zu,xd],__init__:["contextPadProvider"],contextPadProvider:["type",bd]};function wd(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}wd.$inject=["injector","canvas","graphicsFactory","elementFactory"],wd.prototype.drawPreview=function(e,t,n){n=n||{};var i,o,r,s=e.connectionPreviewGfx,a=e.getConnection,l=n.source,c=n.target,u=n.waypoints,h=n.connectionStart,d=n.connectionEnd,p=n.noLayout,f=n.noCropping,g=n.noNoop,m=this;s||(s=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Nn(s),a||(a=e.getConnection=(o=function(e,t,n){return m.getConnection(e,t,n)},r={},function(e){var t=JSON.stringify(e),n=r[t];return n||(n=r[t]=o.apply(null,arguments)),n})),t&&(i=a(t,l,c)),i?(i.waypoints=u||[],this._layouter&&!p&&(i.waypoints=this._layouter.layoutConnection(i,{source:l,target:c,connectionStart:h,connectionEnd:d,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[l?mo(l):h,c?mo(c):d]),this._connectionDocking&&(l||c)&&!f&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,l,c)),this._graphicsFactory.drawConnection(s,i,{stroke:"var(--element-dragger-color)"})):!g&&this.drawNoopPreview(s,n)},wd.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,o=t.connectionStart||mo(n),r=t.connectionEnd||mo(i),s=this.cropWaypoints(o,r,n,i);An(e,this.createNoopConnection(s[0],s[1]))},wd.prototype.cropWaypoints=function(e,t,n,i){var o=this._graphicsFactory,r=n&&o.getShapePath(n),s=i&&o.getShapePath(i),a=o.getConnectionPath({waypoints:[e,t]});return[e=n&&yo(r,a,!0)||e,t=i&&yo(s,a,!1)||t]},wd.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&ti(e.connectionPreviewGfx)},wd.prototype.getConnection=function(e){var t=function(e){return s(e)?e:{}}(e);return this._elementFactory.createConnection(t)},wd.prototype.createConnectionPreviewGfx=function(){var e=Qn("g");return jn(e,{pointerEvents:"none"}),Bn(e).add("djs-dragger"),An(this._canvas.getActiveLayer(),e),e},wd.prototype.createNoopConnection=function(e,t){return ci([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};var Cd={__init__:["connectionPreview"],connectionPreview:["type",wd]};const Od=/\s/,kd=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,Ed=/^[a-z_][\w-.]*$/i,Sd=/\$\{([^}]*)\}/g;function Rd(e,t){const n=e.$model.ids.assigned(t);return t?n&&n!==e?"Element must have unique ID.":function(e){if(e=function(e){return e.replace(Sd,"$1")}(e),function(e){return Od.test(e)}(e))return"Id must not contain spaces.";if(!Ed.test(e))return kd.test(e)?"Id must not contain prefix.":"Id must be a valid QName."}(t):"Element must have ID."}function Td(e,t,n,i,o){this._eventBus=e,this._modeling=t,this._canvas=n,this._definitionPropertiesView=i,this._translate=o,e.on("definitionIdView.create",(function(e){this._container=e.html;var t=Zt(".dmn-definitions-name",this._container),n=Zt(".dmn-definitions-id",this._container);this._setup(t,"name"),this._setup(n,"id")}),this)}Td.$inject=["eventBus","modeling","canvas","definitionPropertiesView","translate"],Td.prototype.update=function(e,t){var n=this._canvas.getRootElement(),i={};if(i[e]=t,"id"===e){var o=Rd(fn(n),t);if(o)return void this._addErrorMessage(o);this._clearErrorMessage()}this._modeling.updateProperties(n,i)},Td.prototype._setup=function(e,t){var n=this;e.setAttribute("contenteditable",!0),e.addEventListener("input",R((function(e){var i=e.target.value||e.target.textContent;n.update(t,i.trim())}),300)),e.addEventListener("keydown",(function(t){13===t.keyCode&&(e.blur(),window.getSelection().removeAllRanges())})),e.addEventListener("blur",(function(){n._clearErrorMessage(),n._definitionPropertiesView.update()}))},Td.prototype._addErrorMessage=function(e){const t='<span class="dmn-definitions-error-message">'+this._translate(e)+"</span>";var n=Zt(".dmn-definitions-id",this._container);this._clearErrorMessage(),$t(n).add("dmn-definitions-error"),n.parentElement.appendChild(Gt(t))},Td.prototype._clearErrorMessage=function(){var e=Zt(".dmn-definitions-id",this._container);if($t(e).has("dmn-definitions-error")){$t(e).remove("dmn-definitions-error");const t=Zt(".dmn-definitions-error-message",this._container);e.parentNode.removeChild(t)}};var Md={__depends__:[Va],__init__:["definitionPropertiesEdit","definitionPropertiesPaletteAdapter"],definitionPropertiesEdit:["type",Td],definitionPropertiesPaletteAdapter:["type",qa]},Ad={horizontal:["x","width"],vertical:["y","height"]};function Pd(e,t){this._modeling=e,this._filters=[],this.registerFilter((function(e){var n=t.allowed("elements.distribute",{elements:e});return r(n)?n:n?e:[]}))}Pd.$inject=["modeling","rules"],Pd.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},Pd.prototype.trigger=function(e,t){var n,i,o=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return o.distributeElements(n,this._axis,this._dimension),n},Pd.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,o=[].concat(e);return t.length?(p(t,(function(e){o=e(o,n,i)})),o):e},Pd.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,o=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return p(w(e,i),(function(e,r){var s,a=n._findRange(e,i,o),l=t[t.length-1];l&&n._hasIntersection(l.range,a)?t[t.length-1].elements.push(e):(s={range:a,elements:[e]},t.push(s))})),t},Pd.prototype._setOrientation=function(e){var t=Ad[e];this._axis=t[0],this._dimension=t[1]},Pd.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Pd.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};var Dd={__init__:["distributeElements"],distributeElements:["type",Pd]};function $d(e){e.registerFilter((function(e){return d(e,(function(e){var t=gn(e,["dmn:AuthorityRequirement","dmn:InformationRequirement","dmn:KnowledgeRequirement","dmn:Association","dmn:TextAnnotation"]);return!(e.labelTarget||t)}))}))}$d.$inject=["distributeElements"];var jd={__depends__:[Dd],__init__:["drdDistributeElements"],drdDistributeElements:["type",$d]},Id="is not a registered action";function Bd(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function Ld(e,t){return new Error(e+" "+t)}Bd.$inject=["eventBus","injector"],Bd.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),o=e.get("zoomScroll",!1),s=e.get("copyPaste",!1),a=e.get("canvas",!1),l=e.get("rules",!1),c=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),s&&i&&this.register("copy",(function(){var e=i.get();if(e.length)return s.copy(e)})),s&&this.register("paste",(function(){s.paste()})),o&&this.register("stepZoom",(function(e){o.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&l&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,o=l.allowed("elements.delete",{elements:e});!1!==o&&(t=r(o)?o:e).length&&n.removeElements(t.slice())}})),c&&this.register("moveCanvas",(function(e){c.moveCanvas(e)})),u&&this.register("moveSelection",(function(e){u.moveSelection(e.direction,e.accelerated)}))},Bd.prototype.trigger=function(e,t){if(!this._actions[e])throw Ld(e,Id);return this._actions[e](t)},Bd.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);p(e,(function(e,t){n._registerAction(t,e)}))},Bd.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Ld(e,"is already registered");this._actions[e]=t},Bd.prototype.unregister=function(e){if(!this.isRegistered(e))throw Ld(e,Id);this._actions[e]=void 0},Bd.prototype.getActions=function(){return Object.keys(this._actions)},Bd.prototype.isRegistered=function(e){return!!this._actions[e]};var Nd={__init__:["editorActions"],editorActions:["type",Bd]};function qd(e){e.invoke(Bd,this)}yn(qd,Bd),qd.$inject=["injector"],qd.prototype._registerDefaultActions=function(e){Bd.prototype._registerDefaultActions.call(this,e);const t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),o=e.get("lassoTool",!1),r=e.get("handTool",!1),s=e.get("directEditing",!1),a=e.get("distributeElements",!1),l=e.get("alignElements",!1),c=e.get("searchPad",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),o=n.filter((function(t){return t!==e}));return i.select(o),o})),i&&a&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length>2&&a.trigger(t,n)})),i&&l&&this._registerAction("alignElements",(function(e){var t=i.get(),n=e.type;t.length>1&&l.trigger(t,n)})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),r&&this._registerAction("handTool",(function(){r.toggle()})),i&&s&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&s.activate(e[0])})),i&&c&&this._registerAction("find",(function(){c.toggle()}))};var Vd={__depends__:[Nd],editorActions:["type",qd]};function Fd(e){return e.dmnDI&&e.dmnDI.diagrams&&e.dmnDI.diagrams[0]}function zd(e,t,n,i){n.on("import.start",(({definitions:n})=>{Fd(n)||function(n){var o=n.dmnDI;o||(o=e.create("dmndi:DMNDI"),n.set("dmnDI",o));var r=e.create("dmndi:DMNDiagram");o.set("diagrams",[r]);var s=0;p(n.get("drgElement"),(function(n){if(hn(n,"dmn:Decision")){var o=t._getDefaultSize(n),a=e.createDiShape(n,{x:150+30*s,y:150+30*s,width:o.width,height:o.height});i.updateDiParent(a,r),s++}}))}(n)}))}zd.$inject=["drdFactory","elementFactory","eventBus","drdUpdater"];var Qd={__init__:["diGenerator"],diGenerator:["type",zd]};function Hd(e,t,n){return n||(n="round"),Math[n](e/t)*t}function Wd(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var o=this;t.on("diagram.init",800,(function(){o.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;if(!(!o.active||n&&pl(n))){var i=t.context,r=i.gridSnappingContext;r||(r=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},r=function(e,t,n){var i=e.context,o=e.shape,r=i.gridSnappingContext,s=r.snapLocation,l=r.snapOffset;if(l&&a(l[t]))return l[t];l||(l=r.snapOffset={});a(l[t])||(l[t]=0);if(!o)return l[t];n.get(o.id)||(Ud(t)?l[t]+=o[t]+o.width/2:l[t]+=o[t]+o.height/2);if(!s)return l[t];"x"===t?/left/.test(s)?l[t]-=o.width/2:/right/.test(s)&&(l[t]+=o.width/2):/top/.test(s)?l[t]-=o.height/2:/bottom/.test(s)&&(l[t]+=o.height/2);return l[t]}(t,n,e);r&&(i.offset=r);var s=function(e,t){var n=e.context,i=n.createConstraints,o=n.resizeConstraints||{},r=n.gridSnappingContext,s=r.snapConstraints;if(s&&s[t])return s[t];s||(s=r.snapConstraints={});s[t]||(s[t]={});var a=n.direction;i&&(Ud(t)?(s.x.min=i.left,s.x.max=i.right):(s.y.min=i.top,s.y.max=i.bottom));var l=o.min,c=o.max;l&&(Ud(t)?Kd(a)?s.x.max=l.left:s.x.min=l.right:Xd(a)?s.y.max=l.top:s.y.min=l.bottom);c&&(Ud(t)?Kd(a)?s.x.min=c.left:s.x.max=c.right:Xd(a)?s.y.min=c.top:s.y.max=c.bottom);return s[t]}(t,n);s&&M(i,s),eu(t,n)||o.snapEvent(t,n,i)}))}}))}function Ud(e){return"x"===e}function Xd(e){return-1!==e.indexOf("n")}function Kd(e){return-1!==e.indexOf("w")}Wd.prototype.snapEvent=function(e,t,n){tu(e,t,this.snapValue(e[t],n))},Wd.prototype.getGridSpacing=function(){return 10},Wd.prototype.snapValue=function(e,t){var n,i,o=0;return t&&t.offset&&(o=t.offset),e=Hd(e+=o,10),t&&t.min&&a(n=t.min)&&(n=Hd(n+o,10,"ceil"),e=Math.max(e,n)),t&&t.max&&a(i=t.max)&&(i=Hd(i+o,10,"floor"),e=Math.min(e,i)),e-=o},Wd.prototype.isActive=function(){return this.active},Wd.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Wd.prototype.toggleActive=function(){this.setActive(!this.active)},Wd.$inject=["elementRegistry","eventBus","config.gridSnapping"];function Gd(e){this._eventBus=e}function Yd(e){return function(t,n,i,o,r){(l(t)||a(t))&&(r=o,o=i,i=n,n=t,t=null),this.on(t,e,n,i,o,r)}}function Zd(e,t){Gd.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var o=t.shape,r=t.newBounds;c(i)?t.newBounds=n.snapComplex(r,i):t.newBounds=n.snapSimple(o,r)}}))}Gd.$inject=["eventBus"],Gd.prototype.on=function(e,t,n,i,o,c){if((l(t)||a(t))&&(c=o,o=i,i=n,n=t,t=null),l(n)&&(c=o,o=i,i=n,n=1e3),s(o)&&(c=o,o=!1),!l(i))throw new Error("handlerFn must be a function");r(e)||(e=[e]);var u=this._eventBus;p(e,(function(e){var r=["commandStack",e,t].filter((function(e){return e})).join(".");u.on(r,n,o?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,c):i,c)}))},Gd.prototype.canExecute=Yd("canExecute"),Gd.prototype.preExecute=Yd("preExecute"),Gd.prototype.preExecuted=Yd("preExecuted"),Gd.prototype.execute=Yd("execute"),Gd.prototype.executed=Yd("executed"),Gd.prototype.postExecute=Yd("postExecute"),Gd.prototype.postExecuted=Yd("postExecuted"),Gd.prototype.revert=Yd("revert"),Gd.prototype.reverted=Yd("reverted"),Zd.$inject=["eventBus","gridSnapping","modeling"],yn(Zd,Gd),Zd.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Zd.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Zd.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),o=/e/.test(t),r={};return r.width=n.snapValue(e.width,{min:e.width}),o&&(i?(r.x=n.snapValue(e.x,{max:e.x}),r.width+=n.snapValue(e.x-r.x,{min:e.x-r.x})):e.x=e.x+e.width-r.width),M(e,r),e},Zd.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),o=/s/.test(t),r={};return r.height=n.snapValue(e.height,{min:e.height}),i&&(o?(r.y=n.snapValue(e.y,{max:e.y}),r.height+=n.snapValue(e.y-r.y,{min:e.y-r.y})):e.y=e.y+e.height-r.height),M(e,r),e};function Jd(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}Jd.$inject=["eventBus","gridSnapping"];var ep={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Zd],gridSnappingSpaceToolBehavior:["type",Jd]}],__init__:["gridSnapping"],gridSnapping:["type",Wd]},tp="keyboard.keydown",np="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function ip(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(np));var i=e&&!1!==e.bind;t.on("canvas.init",(function(e){n._target=e.svg,i&&n.bind(),n._fire("init")}))}ip.$inject=["config.keyboard","eventBus"],ip.prototype._keydownHandler=function(e){this._keyHandler(e,tp)},ip.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ip.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||tp,n)&&e.preventDefault()}},ip.prototype._isEventIgnored=function(e){return!1},ip.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(np)),this.unbind(),e=this._node=this._target,zt.bind(e,"keydown",this._keydownHandler),zt.bind(e,"keyup",this._keyupHandler),this._fire("bind")},ip.prototype.getBinding=function(){return this._node},ip.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),zt.unbind(e,"keydown",this._keydownHandler),zt.unbind(e,"keyup",this._keyupHandler)),this._node=null},ip.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ip.prototype.addListener=function(e,t,n){l(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||tp,e,t)},ip.prototype.removeListener=function(e,t){this._eventBus.off(t||tp,e)},ip.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ip.prototype.isCmd=pl,ip.prototype.isShift=gl,ip.prototype.isKey=fl;var op=500;function rp(e,t){var n=this;e.on("editorActions.init",op,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}rp.$inject=["eventBus","keyboard"],rp.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(ml(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(vl(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return pl(e)&&fl(cl,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return pl(e)&&fl(ul,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(fl(["+","Add","="],n)&&pl(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(fl(["-","Subtract"],n)&&pl(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(fl("0",n)&&pl(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(fl(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var sp={__init__:["keyboard","keyboardBindings"],keyboard:["type",ip],keyboardBindings:["type",rp]};function ap(e){e.invoke(rp,this)}yn(ap,rp),ap.$inject=["injector"],ap.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}rp.prototype.registerBindings.call(this,e,t),n("selectElements",(function(n){var i=n.keyEvent;if(e.isKey(["a","A"],i)&&e.isCmd(i))return t.trigger("selectElements"),!0})),n("lassoTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["l","L"],i)?(t.trigger("lassoTool"),!0):void 0})),n("handTool",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["h","H"],i)?(t.trigger("handTool"),!0):void 0})),n("directEditing",(function(n){var i=n.keyEvent;if(!e.hasModifier(i))return e.isKey(["e","E"],i)?(t.trigger("directEditing"),!0):void 0})),n("find",(function(n){var i=n.keyEvent;if(e.isKey(["f","F"],i)&&e.isCmd(i))return t.trigger("find"),!0}))};var lp={__depends__:[sp],__init__:["keyboardBindings"],keyboardBindings:["type",ap]},cp={moveSpeed:50,moveSpeedAccelerated:200};function up(e,t,n){var i=this;this._config=M({},cp,e||{}),t.addListener((function(e){var n=e.keyEvent,o=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var r,s=t.isShift(n)?o.moveSpeedAccelerated:o.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":r="left";break;case"ArrowUp":case"Up":r="up";break;case"ArrowRight":case"Right":r="right";break;case"ArrowDown":case"Down":r="down"}return i.moveCanvas({speed:s,direction:r}),!0}})),this.moveCanvas=function(e){var t=0,i=0,o=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=o;break;case"up":i=o;break;case"right":t=-o;break;case"down":i=-o}n.scroll({dx:t,dy:i})}}up.$inject=["config.keyboardMove","keyboard","canvas"];var hp={__depends__:[sp],__init__:["keyboardMove"],keyboardMove:["type",up]},dp={moveSpeed:1,moveSpeedAccelerated:10},pp="left",fp="right",gp="down",mp={ArrowLeft:pp,Left:pp,ArrowUp:"up",Up:"up",ArrowRight:fp,Right:fp,ArrowDown:gp,Down:gp},vp={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function yp(e,t,n,i,o){var r=this;this._config=M({},dp,e||{}),t.addListener(1500,(function(e){var n=e.keyEvent,i=mp[n.key];if(i&&!t.isCmd(n)){var o=t.isShift(n);return r.moveSelection(i,o),!0}})),this.moveSelection=function(e,t){var r=o.get();if(r.length){var s=this._config[t?"moveSpeedAccelerated":"moveSpeed"],a=vp[e](s);i.allowed("elements.move",{shapes:r})&&n.moveElements(r,a)}}}yp.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var xp={__depends__:[sp,Aa],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",yp]};function bp(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}bp.$inject=["eventBus","injector"],bp.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},bp.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let o=this._fire(e,"canExecute",n);if(void 0===o){if(!i)return!1;i.canExecute&&(o=i.canExecute(t))}return o},bp.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},bp.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},bp.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},bp.prototype.register=function(e,t){this._setHandler(e,t)},bp.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},bp.prototype.canUndo=function(){return!!this._getUndoAction()},bp.prototype.canRedo=function(){return!!this._getRedoAction()},bp.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},bp.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},bp.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo((()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)}))},bp.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let o;n=this._eventBus.createEvent(n);for(const e of i)if(o=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return o},bp.prototype._createId=function(){return this._uid++},bp.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},bp.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,o=this._getHandler(n);if(!o)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),o.preExecute&&o.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo((()=>{this._fire(n,"execute",e),o.execute&&this._markDirty(o.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)})),t||(this._fire(n,"postExecute",e),o.postExecute&&o.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},bp.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},bp.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:_("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},bp.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=r(e)?e:[e],t.dirty=t.dirty.concat(e))},bp.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},bp.prototype._revertedAction=function(e){this._stackIdx--},bp.prototype._getHandler=function(e){return this._handlerMap[e]},bp.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var _p={commandStack:["type",bp]};function wp(e,t,n,i){e.on("element.changed",(function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(vi(o)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}wp.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Cp={__init__:["changeSupport"],changeSupport:["type",wp]},Op=Math.min,kp=Math.max;function Ep(e){e.preventDefault()}function Sp(e){e.stopPropagation()}function Rp(e){this.container=e.container,this.parent=Gt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Zt("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=T(this.autoResize,this),this.handlePaste=T(this.handlePaste,this)}function Tp(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new Rp({container:t.getContainer(),keyHandler:T(this._handleKey,this),resizeHandler:T(this._handleResize,this)})}Rp.prototype.create=function(e,t,n,i){var o=this.parent,r=this.content,s=this.container;i=this.options=i||{};var a=A(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);M(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},a);var l=A(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return M(r.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&M(r.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),r.innerText=n,zt.bind(r,"keydown",this.keyHandler),zt.bind(r,"mousedown",Sp),zt.bind(r,"paste",this.handlePaste),i.autoResize&&zt.bind(r,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(r.lastChild,r.lastChild&&r.lastChild.length),o},Rp.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var o=this.autoResize(i);o&&this.resizeHandler(o)}},Rp.prototype.insertText=function(e){e=function(e){return e.replace(/\r\n|\r|\n/g,"\n")}(e),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Rp.prototype._insertTextIE=function(e){var t,n,i,o=this.getSelection(),r=o.startContainer,s=o.endContainer,a=o.startOffset,l=o.endOffset,c=o.commonAncestorContainer,u=(t=c.childNodes,[].slice.call(t));if(function(e){return e.nodeType===Node.TEXT_NODE}(c)){var h=r.textContent;r.textContent=h.substring(0,a)+e+h.substring(l),n=r,i=a+e.length}else if(r===this.content&&s===this.content){var d=document.createTextNode(e);this.content.insertBefore(d,u[a]),n=d,i=d.textContent.length}else{var p=u.indexOf(r),f=u.indexOf(s);u.forEach((function(t,n){n===p?t.textContent=r.textContent.substring(0,a)+e+s.textContent.substring(l):n>p&&n<=f&&en(t)})),n=r,i=a+e.length}n&&void 0!==i&&setTimeout((function(){self.setSelection(n,i)}))},Rp.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),o=t.scrollHeight;e.style.height=o+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:o-i.height})}},Rp.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,o=parseInt(this.style.minHeight)||0,r=parseInt(this.style.maxWidth)||1/0,s=parseInt(this.style.maxHeight)||1/0;if(!n){var a,l,c,u;n=this.resizeHandle=Gt('<div class="djs-direct-editing-resize-handle"></div>');var h=function(n){Ep(n),Sp(n);var h=Op(kp(c+n.clientX-a,i),r),d=Op(kp(u+n.clientY-l,o),s);t.style.width=h+"px",t.style.height=d+"px",e.resizeHandler({width:c,height:u,dx:n.clientX-a,dy:n.clientY-l})},d=function(e){Ep(e),Sp(e),zt.unbind(document,"mousemove",h,!1),zt.unbind(document,"mouseup",d,!1)};zt.bind(n,"mousedown",(function(e){Ep(e),Sp(e),a=e.clientX,l=e.clientY;var n=t.getBoundingClientRect();c=n.width,u=n.height,zt.bind(document,"mousemove",h),zt.bind(document,"mouseup",d)}))}M(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},Rp.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),zt.unbind(t,"keydown",this.keyHandler),zt.unbind(t,"mousedown",Sp),zt.unbind(t,"input",this.autoResize),zt.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),en(n)),en(e)},Rp.prototype.getValue=function(){return this.content.innerText.trim()},Rp.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Rp.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},Tp.$inject=["eventBus","canvas"],Tp.prototype.registerProvider=function(e){this._providers.push(e)},Tp.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},Tp.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Tp.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Tp.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},Tp.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),o=this.getValue();o===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,o,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Tp.prototype.getValue=function(){return this._textbox.getValue()},Tp.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},Tp.prototype._handleResize=function(e){this._fire("resize",e)},Tp.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=h(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};var Mp={__depends__:[Oa],__init__:["directEditing"],directEditing:["type",Tp]},Ap="djs-label-hidden";function Pp(e,t,n,i,o){this._canvas=e,this._modeling=i,this._textRenderer=o,this._eventBus=n,t.registerProvider(this),n.on("element.dblclick",(function(e){t.activate(e.element)})),n.on(["autoPlace.start","canvas.viewbox.changing","drag.init","drillDown.click","element.mousedown","popupMenu.open","selection.changed"],(function(){t.complete()})),n.on(["commandStack.changed"],(function(){t.cancel()})),n.on("create.end",500,(function(e){var n=e.shape;(hn(n,"dmn:Decision")||hn(n,"dmn:InputData")||hn(n,"dmn:BusinessKnowledgeModel")||hn(n,"dmn:KnowledgeSource")||hn(n,"dmn:TextAnnotation"))&&t.activate(n)})),n.on("autoPlace.end",500,(function(e){t.activate(e.shape)})),this._eventBus.on(["directEditing.complete","directEditing.cancel"],(function(t){var n=t.active;if(n){var i=n.element.label||n.element;e.removeMarker(i,Ap)}}))}Pp.$inject=["canvas","directEditing","eventBus","modeling","textRenderer"],Pp.prototype.activate=function(e){var t=wl(e);if(i(t)){var n={text:t};M(n,this.getEditingBBox(e));var o={},r=n.style||{};return hn(e,"dmn:DRGElement")&&(M(o,{centerVertically:!0}),M(r,{backgroundColor:null,border:null})),hn(e,"dmn:TextAnnotation")&&M(o,{resizable:!0}),M(n,{options:o,style:r}),this._canvas.addMarker(e,Ap),n}},Pp.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),o={x:i.x,y:i.y},r=t.zoom(),s=this._textRenderer.getDefaultStyle(),a=s.fontSize*r,l=s.lineHeight,c={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};return hn(e,"dmn:DRGElement")&&(M(o,{width:i.width,height:i.height}),M(c,{fontSize:a+"px",lineHeight:l,paddingTop:7*r+"px",paddingBottom:7*r+"px",paddingLeft:5*r+"px",paddingRight:5*r+"px"})),hn(e,"dmn:TextAnnotation")&&(M(o,{width:i.width,height:i.height,minWidth:30*r,minHeight:10*r}),M(c,{textAlign:"left",paddingTop:5*r+"px",paddingBottom:7*r+"px",paddingLeft:7*r+"px",paddingRight:5*r+"px",fontSize:a+"px",lineHeight:l})),{bounds:o,style:c}},Pp.prototype.update=function(e,t,n,i){var o,r,s;hn(e,"dmn:TextAnnotation")&&(r=this._canvas.getAbsoluteBBox(e),o={x:e.x,y:e.y,width:e.width/r.width*i.width,height:e.height/r.height*i.height}),(s=t)&&s.trim()||(t=null),this._modeling.updateLabel(e,t,o)};var Dp={__depends__:[_p,Cp,Mp],__init__:["labelEditingProvider"],labelEditingProvider:["type",Pp]};function $p(e,t){t.invoke(Gd,this),this.preExecute("connection.create",(function(t){var n=t.connection,i=n.businessObject,o=t.source,r=t.target;hn(n,"dmn:Association")?((i.sourceRef=e.create("dmn:DMNElementReference",{href:"#"+o.id})).$parent=i,(i.targetRef=e.create("dmn:DMNElementReference",{href:"#"+r.id})).$parent=i):(i["required"+function(e){if(hn(e,"dmn:BusinessKnowledgeModel"))return"Knowledge";if(hn(e,"dmn:Decision"))return"Decision";if(hn(e,"dmn:InputData"))return"Input";if(hn(e,"dmn:KnowledgeSource"))return"Authority"}(o)]=e.create("dmn:DMNElementReference",{href:"#"+o.id})).$parent=i}),!0)}$p.$inject=["drdFactory","injector"],yn($p,Gd);function jp(e,t,n,i){function o(e,i,o){i||(i=e.incoming.filter((function(e){return hn(e,"dmn:InformationRequirement")})));var r={};o?r[o]=i:r=function(e,t){var n={};return t.forEach((function(t){var i=vo(t.source,e).split("-").shift();n[i]||(n[i]=[]),n[i].push(t)})),n}(e,i),p(r,(function(i,o){i=function(e,t){var n;n=t.includes("top")||t.includes("bottom")?"x":"y";return e.sort((function(e,t){return mo(e.source)[n]-mo(t.source)[n]}))}(i,o);var r=function(e,t,n){return e.map((function(i,o){var r=i.source,s=mo(r),a=po(r),l=po(t),c=e.length;return n.includes("bottom")?{start:{x:s.x,y:a.top},end:{x:l.left+t.width/(c+1)*(o+1),y:l.bottom}}:n.includes("top")?{start:{x:s.x,y:a.bottom},end:{x:l.left+t.width/(c+1)*(o+1),y:l.top}}:n.includes("right")?{start:{x:a.left,y:s.y},end:{x:l.right,y:l.top+t.height/(c+1)*(o+1)}}:{start:{x:a.right,y:s.y},end:{x:l.left,y:l.top+t.height/(c+1)*(o+1)}}}))}(i,e,o);i.forEach(((e,i)=>{var o=r[i].start,s=r[i].end,a=t.layoutConnection(e,{connectionStart:o,connectionEnd:s});n.updateWaypoints(e,a)}))}))}e.invoke(Gd,this),this.preExecute(["connection.create","connection.reconnect"],(function(e){var t=e.connection,n=e.newSource||e.source,o=e.newTarget||e.target;if((!hn(t,"dmn:InformationRequirement")||i.allowed("connection.connect",{connection:t,source:n,target:o}))&&hn(t,"dmn:InformationRequirement")){var r=vo(n,o);e.hints||(e.hints={}),M(e.hints,function(e,t,n){var i=mo(e),o=mo(t);n.includes("bottom")?(i.y=e.y,o.y=t.y+t.height):n.includes("top")?(i.y=e.y+e.height,o.y=t.y):n.includes("right")?(i.x=e.x,o.x=t.x+t.width):(i.x=e.x+e.width,o.x=t.x);return{connectionStart:i,connectionEnd:o}}(n,o,r))}}),!0),this.postExecuted(["connection.create","connection.delete","connection.reconnect"],(function(e){var t=e.connection,n=t.source||e.source,i=t.target||e.target;if(hn(t,"dmn:InformationRequirement")){var r=vo(n,i),s=i.incoming.filter((e=>{var t=vo(e.source,e.target);return hn(e,"dmn:InformationRequirement")&&Ip(t,r)}));s.length&&o(i,s,r)}}),!0),this.preExecute("connection.reconnect",(function(e){var t=e.connection,n=t.source,i=t.target;if(hn(t,"dmn:InformationRequirement")){var r=vo(n,i),s=i.incoming.filter((e=>{var n=vo(e.source,e.target);return e!==t&&hn(e,"dmn:InformationRequirement")&&Ip(n,r)}));s.length&&o(i,s,r)}}),!0),this.postExecuted("elements.move",500,(function(e){var t=e.shapes,n=e.closure.enclosedConnections;t.forEach((function(e){if(gn(e,["dmn:Decision","dmn:InputData"])){var t=e.incoming.filter((function(e){return hn(e,"dmn:InformationRequirement")&&!n[e.id]}));t.length&&o(e,t),e.outgoing.forEach((function(e){hn(e,"dmn:InformationRequirement")&&!n[e.id]&&o(e.target)}))}}))}),!0)}function Ip(e,t){return e&&t&&e.split("-").shift()===t.split("-").shift()}function Bp(e,t,n){e.invoke(Gd,this),this.preExecute("connection.reconnect",(function(e){var i=e.connection,o=e.newSource||i.source,r=e.newTarget||i.target,s=i.waypoints.slice(),a=n.allowed("connection.reconnect",{connection:i,source:o,target:r});a&&a.type!==i.type&&(e.connection=t.connect(o,r,{type:a.type,waypoints:s}),t.removeConnection(i))}),!0)}function Lp(e,t,n){Gd.call(this,e),this._modeling=t,this.postExecuted(["shape.replace"],1500,(function(e){var i=e.context,o=i.oldShape,r=i.newShape;t.unclaimId(o.businessObject.id,o.businessObject),t.updateProperties(r,{id:o.id}),n.select(r)}))}jp.$inject=["injector","layouter","modeling","rules"],yn(jp,Gd),yn(Bp,Gd),Bp.$inject=["injector","modeling","rules"],yn(Lp,Gd),Lp.$inject=["eventBus","modeling","selection"];const Np="id";class qp extends Gd{constructor(e){super(e),this.executed("element.updateProperties",this.updateIds.bind(this))}updateIds({context:e}){const{element:t,oldProperties:n,properties:i}=e,o=fn(t);if(this.shouldSkipUpdate(o,n,i))return;const r=function(e){let t=e;for(;!hn(t,"dmn:Definitions");)t=t.$parent;return t}(o);r.get("drgElement").forEach((e=>{!function(e,t,n){const i={authorityRequirement:()=>{e.authorityRequirement.forEach((e=>{const{requiredAuthority:i,requiredDecision:o,requiredInput:r}=e;i&&i.href===`#${t}`&&(i.href=`#${n}`),o&&o.href===`#${t}`&&(o.href=`#${n}`),r&&r.href===`#${t}`&&(r.href=`#${n}`)}))},informationRequirement:()=>{e.informationRequirement.forEach((e=>{const{requiredDecision:i,requiredInput:o}=e;i&&i.href===`#${t}`&&(i.href=`#${n}`),o&&o.href===`#${t}`&&(o.href=`#${n}`)}))},knowledgeRequirement:()=>{e.knowledgeRequirement.forEach((e=>{const{requiredKnowledge:i}=e;i&&i.href===`#${t}`&&(i.href=`#${n}`)}))}};p(i,((t,n)=>{e[n]&&t()}))}(e,n.id,i.id)}));r.get("artifact").forEach((e=>{!function(e,t,n){const i={sourceRef:()=>{const{sourceRef:i}=e;i.href===`#${t}`&&(i.href=`#${n}`)},targetRef:()=>{const{targetRef:i}=e;i.href===`#${t}`&&(i.href=`#${n}`)}};p(i,((t,n)=>{e[n]&&t()}))}(e,n.id,i.id)}))}shouldSkipUpdate(e,t,n){return!function(e,t){return Np in e&&Np in t}(t,n)||!hn(e,"dmn:DRGElement")&&!hn(e,"dmn:TextAnnotation")}}qp.$inject=["eventBus"];let Vp=class extends Gd{static $inject=["eventBus","modeling"];constructor(e,t){super(e),this._modeling=t,this.postExecuted("element.updateProperties",this.updateVariableFromElement),this.postExecuted("element.updateLabel",this.updateVariableFromLabel)}updateVariableFromLabel=({context:e})=>{const{element:t,newLabel:n}=e,i=fn(t).variable;i&&this._modeling.updateProperties(i,{name:n})};updateVariableFromElement=({context:e})=>{const{element:t,properties:n}=e,i=fn(t);i.variable&&(hn(t,"dmn:Decision")||hn(t,"dmn:BusinessKnowledgeModel"))&&this.isNameChanged(n)&&(this.isVariable(t)||this.shouldSyncVariable(t)||this.syncElementVariableChange(i))};isNameChanged(e){return"name"in e}isVariable(e){const t=function(e){return e.$parent}(e);return hn(e,"dmn:InformationItem")&&t&&t.get("variable")===e}shouldSyncVariable(e){const t=fn(e),n=t.get("variable");return n&&t.name===n.name}syncElementVariableChange(e){const t=e.get("name"),n=e.variable;this._modeling.updateProperties(n,{name:t})}};var Fp={__init__:["createConnectionBehavior","idChangeBehavior","nameChangeBehavior","layoutConnectionBehavior","replaceConnectionBehavior","replaceElementBehavior"],createConnectionBehavior:["type",$p],idChangeBehavior:["type",qp],nameChangeBehavior:["type",Vp],layoutConnectionBehavior:["type",jp],replaceConnectionBehavior:["type",Bp],replaceElementBehavior:["type",Lp]};function zp(e){Gd.call(this,e),this.init()}function Qp(e){e.invoke(zp,this)}function Hp(e,t){if(!e||Xp(e)||!t||Xp(t))return null;if(e===t)return!1;if(hn(e,"dmn:BusinessKnowledgeModel")&&gn(t,["dmn:BusinessKnowledgeModel","dmn:Decision"]))return{type:"dmn:KnowledgeRequirement"};if(hn(e,"dmn:Decision")){if(hn(t,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(hn(t,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}if(hn(e,"dmn:Definitions")||hn(t,"dmn:Definitions"))return!1;if(hn(e,"dmn:InputData")){if(hn(t,"dmn:Decision"))return{type:"dmn:InformationRequirement"};if(hn(t,"dmn:KnowledgeSource"))return{type:"dmn:AuthorityRequirement"}}return hn(e,"dmn:KnowledgeSource")&&gn(t,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:KnowledgeSource"])?{type:"dmn:AuthorityRequirement"}:!!(hn(e,"dmn:TextAnnotation")&&!hn(t,"dmn:TextAnnotation")||!hn(e,"dmn:TextAnnotation")&&hn(t,"dmn:TextAnnotation"))&&{type:"dmn:Association"}}function Wp(e,t){return gn(e,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation"])&&hn(t,"dmn:Definitions")}function Up(e,t){return r(e)||(e=[e]),!t||!(!g(e,(function(e){return gn(e,["dmn:BusinessKnowledgeModel","dmn:Decision","dmn:InputData","dmn:KnowledgeSource","dmn:TextAnnotation","dmn:InformationRequirement","dmn:AuthorityRequirement","dmn:KnowledgeRequirement","dmn:Association"])}))||!hn(t,"dmn:Definitions"))}function Xp(e){return!!e.labelTarget}zp.$inject=["eventBus"],yn(zp,Gd),zp.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},zp.prototype.init=function(){},yn(Qp,zp),Qp.$inject=["injector"],Qp.prototype.init=function(){this.addRule("connection.create",(function(e){return Hp(e.source,e.target)})),this.addRule("connection.reconnect",(function(e){return e.connection,Hp(e.source,e.target)})),this.addRule("connection.updateWaypoints",(function(e){const t=e.connection;return{type:t.type,businessObject:t.businessObject}})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes;return e.position,Up(n,t)})),this.addRule("shape.create",(function(e){return Wp(e.shape,e.target)})),this.addRule("shape.resize",(function(e){return hn(e.shape,"dmn:TextAnnotation")}))},Qp.prototype.canConnect=Hp,Qp.prototype.canCreate=Wp,Qp.prototype.canMove=Up;var Kp={__depends__:[gc],__init__:["drdRules"],drdRules:["type",Qp]};function Gp(e){this._model=e}function Yp(e,t,n,i,o){o.invoke(Gd,this),this._definitionPropertiesView=t,this._drdFactory=n,this._drdRules=i;var r=this;function s(e){var t=e.connection,n=e.parent,i=e.shape;t&&!hn(t,"dmn:Association")&&(n=t.target),r.updateParent(i||t,n)}function a(e){var t=e.connection,n=e.shape,i=e.parent||e.newParent;t&&!hn(t,"dmn:Association")&&(i=t.target),r.updateParent(n||t,i)}function l(e){var t=e.shape;(hn(t,"dmn:DRGElement")||hn(t,"dmn:TextAnnotation"))&&r.updateBounds(t)}function c(e){r.updateConnectionWaypoints(e)}this.executed(["connection.create","connection.layout"],(function(t){var n=t.connection;t.cropped||(n.waypoints=e.getCroppedWaypoints(n),t.cropped=!0)}),!0),this.reverted(["connection.layout"],(function(e){delete e.cropped}),!0),this.executed(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],s,!0),this.reverted(["connection.create","connection.delete","connection.move","shape.create","shape.delete"],a,!0),this.executed(["shape.create","shape.move","shape.resize"],l,!0),this.reverted(["shape.create","shape.move","shape.resize"],l,!0),this.executed(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],c,!0),this.reverted(["connection.create","connection.layout","connection.move","connection.updateWaypoints"],c,!0),this.executed("connection.create",(function(e){var t=e.connection,n=t.businessObject,i=e.target.businessObject;hn(t,"dmn:Association")?s(e):r.updateSemanticParent(n,i)}),!0),this.reverted("connection.create",(function(e){a(e)}),!0),this.executed("connection.reconnect",(function(e){var t=e.connection.businessObject,n=e.newTarget.businessObject;hn(t,"dmn:Association")||r.updateSemanticParent(t,n)}),!0),this.reverted("connection.reconnect",(function(e){var t=e.connection.businessObject,n=e.oldTarget.businessObject;hn(t,"dmn:Association")||r.updateSemanticParent(t,n)}),!0),this.executed("element.updateProperties",(function(e){t.update()}),!0),this.reverted("element.updateProperties",(function(e){t.update()}),!0)}function Zp(e,t){this._modeling=e,this._canvas=t}function Jp(e){this._modeling=e}function ef(e,t){this._canvas=e,this._layouter=t}Gp.$inject=["moddle"],Gp.prototype._needsId=function(e){return gn(e,["dmn:Artifact","dmn:DMNElement","dmn:DRGElement","dmndi:DMNDiagram","dmndi:DMNDiagramElement"])},Gp.prototype._ensureId=function(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Gp.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Gp.prototype.createDiShape=function(e,t,n){return this.create("dmndi:DMNShape",M({dmnElementRef:e,bounds:this.createDiBounds(t)},n))},Gp.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Gp.prototype.createDiEdge=function(e,t,n){return this.create("dmndi:DMNEdge",{dmnElementRef:e,waypoint:this.createDiWaypoints(t)},n)},Gp.prototype.createDiWaypoints=function(e){var t=this;return e.map((function(e){return t.createDiWaypoint(e)}))},Gp.prototype.createDiWaypoint=function(e){return this.create("dc:Point",A(e,["x","y"]))},Gp.prototype.createExtensionElements=function(){return this.create("dmn:ExtensionElements",{values:[]})},yn(Yp,Gd),Yp.$inject=["connectionDocking","definitionPropertiesView","drdFactory","drdRules","injector"],Yp.prototype.updateBounds=function(e){M(e.businessObject.di.bounds,{x:e.x,y:e.y,width:e.width,height:e.height})},Yp.prototype.updateConnectionWaypoints=function(e){var t=this._drdFactory,n=e.connection,i=n.businessObject.di;i.waypoint=t.createDiWaypoints(n.waypoints).map((function(e){return e.$parent=i,e}))},Yp.prototype.updateParent=function(e,t){var n=e.parent;hn(e,"dmn:DRGElement")||hn(e,"dmn:Artifact")||(n=t);var i=e.businessObject,o=n&&n.businessObject;this.updateSemanticParent(i,o),this.updateDiParent(i.di,o&&o.di)},Yp.prototype.updateSemanticParent=function(e,t){var n,i;e.$parent!==t&&(hn(e,"dmn:DRGElement")?i="drgElement":hn(e,"dmn:Artifact")?i="artifact":hn(e,"dmn:InformationRequirement")?i="informationRequirement":hn(e,"dmn:AuthorityRequirement")?i="authorityRequirement":hn(e,"dmn:KnowledgeRequirement")&&(i="knowledgeRequirement"),e.$parent&&wi(n=e.$parent.get(i),e),t?(n=t.get(i))&&(n.push(e),e.$parent=t):e.$parent=null)},Yp.prototype.updateDiParent=function(e,t){if(e.$parent!==t){if(!gn(e,["dmndi:DMNEdge","dmndi:DMNShape"]))throw new Error("unsupported");for(var n=t||e;!hn(n,"dmndi:DMNDiagram");)n=n.$parent;var i=n.get("diagramElements");t?(e.$parent=n,Ci(i,e)):(e.$parent=null,wi(i,e))}},Zp.$inject=["modeling","canvas"],Zp.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,o=e.alignment;p(n,(function(e){var n={x:0,y:0};i(o.left)?n.x=o.left-e.x:i(o.right)?n.x=o.right-e.width-e.x:i(o.center)?n.x=o.center-Math.round(e.width/2)-e.x:i(o.top)?n.y=o.top-e.y:i(o.bottom)?n.y=o.bottom-e.height-e.y:i(o.middle)&&(n.y=o.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},Zp.prototype.postExecute=function(e){},Jp.$inject=["modeling"],Jp.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,o=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:o.attach}),e.shape=i},Jp.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,m(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},ef.$inject=["canvas","layouter"],ef.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,o=e.parent,r=e.parentIndex,s=e.hints;if(!n||!i)throw new Error("source and target required");if(!o)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,s)),this._canvas.addConnection(t,o,r),t},ef.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var tf=Math.round;function nf(e){this._modeling=e}nf.$inject=["modeling"],nf.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,o=e.position,r=e.hints,s=this._modeling;p(t,(function(e){a(e.x)||(e.x=0),a(e.y)||(e.y=0)}));var l=mi(d(t,(function(e){return!e.hidden})));p(t,(function(e){co(e)&&(e.waypoints=v(e.waypoints,(function(e){return{x:tf(e.x-l.x-l.width/2+o.x),y:tf(e.y-l.y-l.height/2+o.y)}}))),M(e,{x:tf(e.x-l.x-l.width/2+o.x),y:tf(e.y-l.y-l.height/2+o.y)})}));var c=hi(t),u={};p(t,(function(e){if(co(e))u[e.id]=a(i)?s.createConnection(u[e.source.id],u[e.target.id],i,e,e.parent||n,r):s.createConnection(u[e.source.id],u[e.target.id],e,e.parent||n,r);else{var t=M({},r);-1===c.indexOf(e)&&(t.autoResize=!1),uo(e)&&(t=P(t,["attach"])),u[e.id]=a(i)?s.createShape(e,A(e,["x","y","width","height"]),e.parent||n,i,t):s.createShape(e,A(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=x(u)};var of=Math.round;function rf(e){this._canvas=e}function sf(e){rf.call(this,e)}rf.$inject=["canvas"],rf.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,o=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?M(t,n):M(t,{x:n.x-of(t.width/2),y:n.y-of(t.height/2)}),this._canvas.addShape(t,i,o),t},rf.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},yn(sf,rf),sf.$inject=["canvas"];var af=rf.prototype.execute;sf.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,af.call(this,e)};var lf=rf.prototype.revert;function cf(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function uf(e,t){this._canvas=e,this._modeling=t}function hf(e,t){this._modeling=e,this._elementRegistry=t}function df(e,t){this._canvas=e,this._modeling=t}function pf(e){this._modeling=e}sf.prototype.revert=function(e){return e.shape.labelTarget=null,lf.call(this,e)},uf.$inject=["canvas","modeling"],uf.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;cf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),cf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})}))},uf.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Oi(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},uf.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Ci(n.children,t,i),this._canvas.addConnection(t,n),t},hf.$inject=["modeling","elementRegistry"],hf.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;p(e.elements,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},df.$inject=["canvas","modeling"],df.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;cf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),cf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),cf(n.children,(function(e){co(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},df.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Oi(i.children,n),t.removeShape(n),n},df.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,o=e.oldParentIndex;return Ci(i.children,n,o),t.addShape(n,i),n},pf.$inject=["modeling"];var ff={x:"y",y:"x"};function gf(e,t){this._layouter=e,this._canvas=t}function mf(){}function vf(e,t,n){var i=Wa(t),o=Wa(n),r=Ua(e,i),s=r.x*(n.width/t.width),a=r.y*(n.height/t.height);return ho({x:o.x+s,y:o.y+a})}function yf(e,t,n){var i=Cf(e),o=Of(i,t),r=i[0];return o.length?o[o.length-1]:vf(r.original||r,n,t)}function xf(e,t,n){var i=Cf(e),o=Of(i,t),r=i[i.length-1];return o.length?o[0]:vf(r.original||r,n,t)}function bf(e,t,n){var i=Cf(e),o=wf(t,n),r=i[0];return vf(r.original||r,o,t)}function _f(e,t,n){var i=Cf(e),o=wf(t,n),r=i[i.length-1];return vf(r.original||r,o,t)}function wf(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Cf(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Of(e,t){return d(v(e,kf),(function(e){return function(e,t){return"intersect"===vo(t,e,1)}(e,t)}))}function kf(e){return e.original||e}function Ef(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Sf(e){this._modeling=e}function Rf(e){this._helper=new Sf(e)}function Tf(e){this._modeling=e,this._helper=new Sf(e)}function Mf(e){this._modeling=e}function Af(e){return e.original||e}function Pf(e,t){this._modeling=e,this._rules=t}function Df(e){this._modeling=e}function $f(e,t){return-1!==e.indexOf(t)}function jf(e){this._modeling=e}function If(e){return M({},e)}function Bf(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Lf(e,t,n){var i=Bf(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Nf(e,t){return-1!==e.indexOf(t)}function qf(e){this._modeling=e}function Vf(e){var t={};return p(e,(function(e){t[e.id]=e.hidden,e.children&&(t=M({},t,Vf(e.children)))})),t}function Ff(e,t){var n=[];return p(e,(function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(Ff(e.children,e.collapsed||t)))})),n}function zf(e,t){var n=[];return p(e,(function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(zf(e.children,t)))})),n}function Qf(e){this._modeling=e}function Hf(e,t){return wi(e&&e.attachers,t)}function Wf(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),Ci(i,t,n)}}function Uf(){}function Xf(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function Kf(e){this._moddle=e}function Gf(){function e(e,t){var n=e.label||e,i=e.labelTarget||e;return function(e,t,n){var i=e.businessObject,o=_l(i);o&&(i[o]=t),n&&(e.hidden=!t)}(n,t,i!==n),[n,i]}this.execute=function(t){return t.oldLabel=wl(t.element),e(t.element,t.newLabel)},this.revert=function(t){return e(t.element,t.oldLabel)}}pf.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,o=e.dimension;function r(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[o],e.range.max)}function s(e){return e[i]+e[o]/2}function a(e){return e.length-1}function l(e){return e.max-e.min}var c,u,h=n[0],d=a(n),f=n[d],g=0;p(n,(function(e,c){var u,h,f;e.elements.length<2?c&&c!==n.length-1&&(r(e,e.elements[0]),g+=l(e.range)):(h=(u=w(e.elements,i))[0],c===d&&(h=u[a(u)]),f=s(h),e.range=null,p(u,(function(n){!function(e,n){var o={y:0};o[i]=e-s(n),o[i]&&(o[ff[i]]=0,t.moveElements([n],o,n.parent))}(f,n),null!==e.range?r(e,n):e.range={min:n[i],max:n[i]+n[o]}})),c&&c!==n.length-1&&(g+=l(e.range)))})),u=Math.abs(f.range.min-h.range.max),(c=Math.round((u-g)/(n.length-1)))<n.length-1||p(n,(function(e,r){var s,a={};e!==h&&e!==f&&(s=n[r-1],e.range.max=0,p(e.elements,(function(n,r){a[ff[i]]=0,a[i]=s.range.max-n[i]+c,e.range.min!==n[i]&&(a[i]+=n[i]-e.range.min),a[i]&&t.moveElements([n],a,n.parent),e.range.max=Math.max(n[i]+n[o],r?e.range.max:0)})))}))},pf.prototype.postExecute=function(e){},gf.$inject=["layouter","canvas"],gf.prototype.execute=function(e){var t=e.connection;return M(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},gf.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},mf.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,o=e.newParentIndex,r=t.parent;return e.oldParent=r,e.oldParentIndex=wi(r.children,t),Ci(i.children,t,o),t.parent=i,p(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},mf.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,o=e.oldParentIndex,r=e.delta;return wi(n.children,t),Ci(i.children,t,o),t.parent=i,p(t.waypoints,(function(e){e.x-=r.x,e.y-=r.y,e.original&&(e.original.x-=r.x,e.original.y-=r.y)})),t},Ef.prototype.add=function(e,t){return this.addAll([e],t)},Ef.prototype.addAll=function(e,t){var i=function(e,t,i){n(t)&&(t=!0),s(t)&&(i=t,t=!0);var o=xi((i=i||{}).allShapes),r=xi(i.allConnections),a=xi(i.enclosedElements),l=xi(i.enclosedConnections),c=xi(i.topLevel,t&&b(e,(function(e){return e.id})));function u(e){c[e.source.id]&&c[e.target.id]&&(c[e.id]=[e]),o[e.source.id]&&o[e.target.id]&&(l[e.id]=a[e.id]=e),r[e.id]=e}return fi(e,(function(e){if(a[e.id]=e,!e.waypoints)return o[e.id]=e,p(e.incoming,u),p(e.outgoing,u),e.children;l[e.id]=r[e.id]=e})),{allShapes:o,allConnections:r,topLevel:c,enclosedConnections:l,enclosedElements:a}}(e,!!t,this);return M(this,i),this},Sf.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Sf.prototype.moveClosure=function(e,t,n,i,o){var r=this._modeling,s=e.allShapes,a=e.allConnections,l=e.enclosedConnections,c=e.topLevel,u=!1;o&&o.parent===n&&(u=!0),p(s,(function(e){r.moveShape(e,t,c[e.id]&&!u&&n,{recurse:!1,layout:!1})})),p(a,(function(e){var i=!!s[e.source.id],o=!!s[e.target.id];l[e.id]&&i&&o?r.moveConnection(e,t,c[e.id]&&!u&&n):r.layoutConnection(e,{connectionStart:i&&bf(e,e.source,t),connectionEnd:o&&_f(e,e.target,t)})}))},Sf.prototype.getClosure=function(e){return(new Ef).addAll(e,!0)},Rf.$inject=["modeling"],Rf.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Rf.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},Tf.$inject=["modeling"],Tf.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,o=e.newParentIndex,r=t.parent;return e.oldBounds=A(t,["x","y","width","height"]),e.oldParent=r,e.oldParentIndex=wi(r.children,t),Ci(i.children,t,o),M(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Tf.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,o=this._modeling;!1!==i.layout&&(p(t.incoming,(function(e){o.layoutConnection(e,{connectionEnd:_f(e,t,n)})})),p(t.outgoing,(function(e){o.layoutConnection(e,{connectionStart:bf(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},Tf.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,o=e.delta;return Ci(n.children,t,i),M(t,{parent:n,x:t.x-o.x,y:t.y-o.y}),t},Tf.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Tf.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Mf.$inject=["modeling"],Mf.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,o=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return r(o)&&(e.oldWaypoints=i.waypoints,i.waypoints=o),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},Mf.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,o=e.dockingOrPoints,s=e.hints||{},a={};s.connectionStart&&(a.connectionStart=s.connectionStart),s.connectionEnd&&(a.connectionEnd=s.connectionEnd),!1!==s.layoutConnection&&(!n||i&&"source"!==s.docking||(a.connectionStart=a.connectionStart||Af(r(o)?o[0]:o)),!i||n&&"target"!==s.docking||(a.connectionEnd=a.connectionEnd||Af(r(o)?o[o.length-1]:o)),s.newWaypoints&&(a.waypoints=s.newWaypoints),this._modeling.layoutConnection(t,a))},Mf.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,o=e.connection;return t&&(o.source=t),n&&(o.target=n),i&&(o.waypoints=i),o},Pf.$inject=["modeling","rules"],Pf.prototype.preExecute=function(e){var t,n=this,i=this._modeling,o=this._rules,r=e.oldShape,s=e.newData,a=e.hints||{};function l(e,t,n){return o.allowed("connection.reconnect",{connection:n,source:e,target:t})}var c,u={x:s.x,y:s.y},h={x:r.x,y:r.y,width:r.width,height:r.height};t=e.newShape=e.newShape||n.createShape(s,u,r.parent,a),r.host&&i.updateAttachment(t,r.host),!1!==a.moveChildren&&(c=r.children.slice(),i.moveElements(c,{x:0,y:0},t,a));var d=r.incoming.slice(),f=r.outgoing.slice();p(d,(function(e){l(e.source,t,e)&&n.reconnectEnd(e,t,xf(e,t,h),a)})),p(f,(function(e){var i=e.target;l(t,i,e)&&n.reconnectStart(e,t,yf(e,t,h),a)}))},Pf.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Pf.prototype.execute=function(e){},Pf.prototype.revert=function(e){},Pf.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Pf.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Pf.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},Df.$inject=["modeling"],Df.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},M(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Df.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(p(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:xf(e,n,i)})})),p(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:yf(e,n,i)})})))},Df.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return M(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},jf.$inject=["modeling"],jf.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,o=e.resizingShapes,r=e.start,s={};this.moveShapes(i,t),p(o,(function(e){s[e.id]=function(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}(e)})),this.resizeShapes(o,t,n),this.updateConnectionWaypoints(function(e,t){var n=[];return p(e.concat(t),(function(i){var o=i.incoming,r=i.outgoing;p(o.concat(r),(function(i){var o=i.source,r=i.target;($f(e,o)||$f(e,r)||$f(t,o)||$f(t,r))&&($f(n,i)||n.push(i))}))})),n}(i,o),t,n,r,i,o,s)},jf.prototype.execute=function(){},jf.prototype.revert=function(){},jf.prototype.moveShapes=function(e,t){var n=this;p(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},jf.prototype.resizeShapes=function(e,t,n){var i=this;p(e,(function(e){var o=function(e,t,n){var i=e.x,o=e.y,r=e.width,s=e.height,a=n.x,l=n.y;switch(t){case"n":return{x:i,y:o+l,width:r,height:s-l};case"s":return{x:i,y:o,width:r,height:s+l};case"w":return{x:i+a,y:o,width:r-a,height:s};case"e":return{x:i,y:o,width:r+a,height:s};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,o,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},jf.prototype.updateConnectionWaypoints=function(e,t,n,i,o,r,s){var a=this,l=o.concat(r);p(e,(function(e){var c=e.source,u=e.target,h=function(e){return v(e.waypoints,(function(e){return(e=If(e)).original&&(e.original=If(e.original)),e}))}(e),d=Bf(n),p={};Nf(l,c)&&Nf(l,u)?(h=v(h,(function(e){return Lf(e,i,n)&&(e[d]=e[d]+t[d]),e.original&&Lf(e.original,i,n)&&(e.original[d]=e.original[d]+t[d]),e})),a._modeling.updateWaypoints(e,h,{labelBehavior:!1})):(Nf(l,c)||Nf(l,u))&&(Nf(o,c)?p.connectionStart=bf(e,c,t):Nf(o,u)?p.connectionEnd=_f(e,u,t):Nf(r,c)?p.connectionStart=yf(e,c,s[c.id]):Nf(r,u)&&(p.connectionEnd=xf(e,u,s[u.id])),a._modeling.layoutConnection(e,p))}))},qf.$inject=["modeling"],qf.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Vf(n),t.collapsed=!t.collapsed;var i=Ff(n,t.collapsed);return[t].concat(i)},qf.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=zf(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},Qf.$inject=["modeling"],Qf.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Hf(i,t),Wf(n,t),t.host=n,t},Qf.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,o=e.attacherIdx;return t.host=i,Hf(n,t),Wf(i,t,o),t},Uf.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},Uf.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Xf.$inject=["eventBus","elementFactory","commandStack"],Xf.prototype.getHandlers=function(){return{"shape.append":Jp,"shape.create":rf,"shape.delete":df,"shape.move":Tf,"shape.resize":Df,"shape.replace":Pf,"shape.toggleCollapse":qf,spaceTool:jf,"label.create":sf,"connection.create":ef,"connection.delete":uf,"connection.move":mf,"connection.layout":gf,"connection.updateWaypoints":Uf,"connection.reconnect":Mf,"elements.create":nf,"elements.move":Rf,"elements.delete":hf,"elements.distribute":pf,"elements.align":Zp,"element.updateAttachment":Qf}},Xf.prototype.registerHandlers=function(e){p(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},Xf.prototype.moveShape=function(e,t,n,i,o){"object"==typeof i&&(o=i,i=null);var r={shape:e,delta:t,newParent:n,newParentIndex:i,hints:o||{}};this._commandStack.execute("shape.move",r)},Xf.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Xf.prototype.moveElements=function(e,t,n,i){var o,r=(i=i||{}).attach,s=n;!0===r?(o=n,s=n.parent):!1===r&&(o=null);var a={shapes:e,delta:t,newParent:s,newHost:o,hints:i};this._commandStack.execute("elements.move",a)},Xf.prototype.moveConnection=function(e,t,n,i,o){"object"==typeof i&&(o=i,i=void 0);var r={connection:e,delta:t,newParent:n,newParentIndex:i,hints:o||{}};this._commandStack.execute("connection.move",r)},Xf.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Xf.prototype.createConnection=function(e,t,n,i,o,r){"object"==typeof n&&(r=o,o=i,i=n,n=void 0);var s={source:e,target:t,parent:o,parentIndex:n,connection:i=this._create("connection",i),hints:r};return this._commandStack.execute("connection.create",s),s.connection},Xf.prototype.createShape=function(e,t,n,i,o){"number"!=typeof i&&(o=i,i=void 0);var r,s,a=(o=o||{}).attach;e=this._create("shape",e),a?(r=n.parent,s=n):r=n;var l={position:t,shape:e,parent:r,parentIndex:i,host:s,hints:o};return this._commandStack.execute("shape.create",l),l.shape},Xf.prototype.createElements=function(e,t,n,i,o){r(e)||(e=[e]),"number"!=typeof i&&(o=i,i=void 0);var s={position:t,elements:e,parent:n,parentIndex:i,hints:o=o||{}};return this._commandStack.execute("elements.create",s),s.elements},Xf.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var o={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",o),o.shape},Xf.prototype.appendShape=function(e,t,n,i,o){o=o||{};var r={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:o.connection,connectionParent:o.connectionParent,hints:o};return this._commandStack.execute("shape.append",r),r.shape},Xf.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Xf.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Xf.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Xf.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Xf.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Xf.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Xf.prototype.resizeShape=function(e,t,n,i){var o={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",o)},Xf.prototype.createSpace=function(e,t,n,i,o){var r={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:o};this._commandStack.execute("spaceTool",r)},Xf.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Xf.prototype.reconnect=function(e,t,n,i,o){var r={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:o||{}};this._commandStack.execute("connection.reconnect",r)},Xf.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,M(i,{docking:"source"}))},Xf.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,M(i,{docking:"target"}))},Xf.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Xf.prototype._create=function(e,t){return t instanceof $o?t:this._elementFactory.create(e,t)},Xf.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},Kf.$inject=["moddle"],Kf.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},Kf.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};const Yf="id";function Zf(e,t){this._elementRegistry=e,this._moddle=t}function Jf(e,t){return Yf in e&&e[Yf]!==t[Yf]}function eg(e,t){p(t,(function(t,n){e.set(n,t)}))}function tg(e){this._elementRegistry=e}function ng(e,t){p(t,(function(t,n){e.set(n,t)}))}function ig(e,t,n){this._canvas=e,this._drdRules=t,n.invoke(Xf,this)}function og(){}Zf.$inject=["elementRegistry","moddle"],Zf.prototype.execute=function(e){const{element:t,properties:n}=e,i=[t];if(!t)throw new Error("element required");const o=this._elementRegistry,r=this._moddle.ids,s=fn(t),a=e.oldProperties||function(e,t){return f(t,(function(t,n){return t[n]=e.get(n),t}),{})}(s,y(n));return Jf(n,s)&&(r.unclaim(s[Yf]),o.updateId(t,n[Yf]),r.claim(n[Yf],s)),"name"in n&&t.label&&i.push(t.label),eg(s,n),e.oldProperties=a,e.changed=i,i},Zf.prototype.revert=function(e){const{element:t,properties:n,oldProperties:i}=e,o=fn(t),r=this._elementRegistry,s=this._moddle.ids;return eg(o,i),Jf(n,o)&&(s.unclaim(n[Yf]),r.updateId(t,i[Yf]),s.claim(i[Yf],o)),e.changed},tg.$inject=["elementRegistry"],tg.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var o=e.changed||[t],r=e.oldProperties||function(e,t){return f(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,y(i));return ng(n,i),e.oldProperties=r,e.changed=o,o},tg.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return ng(n,t),i},yn(ig,Xf),ig.$inject=["canvas","drdRules","injector"],ig.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},ig.prototype.connect=function(e,t,n,i){var o=this._drdRules,r=this._canvas.getRootElement();return n||(n=o.canConnect(e,t)||{type:"dmn:Association"}),this.createConnection(e,t,n,r,i)},ig.prototype.getHandlers=function(){var e=Xf.prototype.getHandlers.call(this);return e["id.updateClaim"]=Kf,e["element.updateLabel"]=Gf,e["element.updateProperties"]=Zf,e["element.updateModdleProperties"]=tg,e},ig.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},ig.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},ig.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},ig.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},og.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||mo(t.source||e.source),t.connectionEnd||mo(t.target||e.target)]};function rg(e){this._connectionDocking=e}function sg(e,t){return e?e.original||e:mo(t)}function ag(e){return M({original:e.point.original||e.point},e.actual)}function lg(e,t){this._elementRegistry=e,this._graphicsFactory=t}yn(rg,og),rg.$inject=["connectionDocking"],rg.prototype.layoutConnection=function(e,t){var n=this._connectionDocking;t||(t={});var i=t.source||e.source,o=t.target||e.target,r=t.waypoints||e.waypoints||[],s=t.connectionStart,a=t.connectionEnd,l=vo(i,o);if(s||(s=sg(r[0],i)),a||(a=sg(r[r.length-1],o)),hn(e,"dmn:InformationRequirement")){r=[s,a];var c=n.getCroppedWaypoints(M({},e,{waypoints:r}),i,o),u={x:(a=c.pop()).x,y:a.y};return l.includes("bottom")?u.y+=20:l.includes("top")?u.y-=20:l.includes("right")?u.x+=20:u.x-=20,r=c.concat([u,a])}return[s,a]},lg.$inject=["elementRegistry","graphicsFactory"],lg.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),o=this.getDockingPoint(e,n),r=e.waypoints.slice(i.idx+1,o.idx);return r.unshift(ag(i)),r.push(ag(o)),r},lg.prototype.getDockingPoint=function(e,t,n){var i,o,r=e.waypoints;return{point:o=r[i=n?0:r.length-1],actual:this._getIntersection(t,e,n)||o,idx:i}},lg.prototype._getIntersection=function(e,t,n){return yo(this._getShapePath(e),this._getConnectionPath(t),n)},lg.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},lg.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},lg.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var cg={__init__:["modeling","drdUpdater"],__depends__:[Fp,Kp,Va,_p,Aa,Cp],drdFactory:["type",Gp],drdUpdater:["type",Yp],elementFactory:["type",Xl],modeling:["type",ig],layouter:["type",rg],connectionDocking:["type",lg]};function ug(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function o(e){var t=Qn("rect");return jn(t,M({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,r=Zt(".djs-outline",n);r||An(n,r=i.getOutline(t)||o()),i.updateShapeOutline(r,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,r=Zt(".djs-outline",n);r||An(n,r=o()),i.updateConnectionOutline(r,t)}))}ug.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&p(i,(function(i){n=n||i.updateOutline(t,e)})),n||jn(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},ug.prototype.updateConnectionOutline=function(e,t){var n=mi(t);jn(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},ug.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},ug.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ug.prototype.getOutline=function(e){var t;return p(this._getProviders(),(function(n){l(n.getOutline)&&(t=t||n.getOutline(e))})),t},ug.$inject=["eventBus","styles","elementRegistry"];function hg(e,t,n){this._canvas=t;var i=this;e.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateMultiSelectionOutline(n.get())})),e.on("selection.changed",(function(e){var t=e.newSelection;i._updateMultiSelectionOutline(t)}))}hg.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Nn(t);var n=e.length>1;if(Bn(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(mi(e)),o=Qn("rect");jn(o,M({rx:3},i)),Bn(o).add("djs-selection-outline"),An(t,o)}},hg.$inject=["eventBus","canvas","selection"];var dg={__depends__:[Aa],__init__:["outline","multiSelectionOutline"],outline:["type",ug],multiSelectionOutline:["type",hg]},pg=Math.round;function fg(e,t,n,i,o){function r(e,t,n,i){return o.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,o){if(s(i)&&(o=i,i=!1),!n.waypoints&&n.parent&&!Bn(e.target).has("djs-hit-no-move")){var r=function(e){return{x:e.x+pg(e.width/2),y:e.y+pg(e.height/2)}}(n);return t.init(e,r,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:o||{}}}),!0}}e.on("shape.move.start",1500,(function(e){var t=e.context,n=e.shape,o=i.get().slice();-1===o.indexOf(n)&&(o=[n]),o=function(e){var t=b(e,"id");return d(e,(function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0}))}(o),M(t,{shapes:o,validatedShapes:o,shape:n})})),e.on("shape.move.start",1250,(function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=r(n)))return!1})),e.on("shape.move.move",500,(function(e){var t,n=e.context,i=n.validatedShapes,o=e.hover,s={x:e.dx,y:e.dy};t=r(i,s,{x:e.x,y:e.y},o),n.delta=s,n.canExecute=t,n.target=null!==t?o:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,o=t.canExecute,r="attach"===o,s=t.shapes;if(!1===o)return!1;i.x=pg(i.x),i.y=pg(i.y),0===i.x&&0===i.y||n.moveElements(s,i,t.target,{primaryShape:t.shape,attach:r})})),e.on("element.mousedown",(function(e){if(ya(e)){var t=pa(e);if(!t)throw new Error("must supply DOM mousedown event");return a(t,e.element)}})),this.start=a}fg.$inject=["eventBus","dragging","modeling","selection","rules"];var gg="djs-dragging",mg="drop-ok",vg="drop-not-ok",yg="new-parent",xg="attach-ok";function bg(e,t,n,i){function o(e){var t=function(e){var t=d(e,(function(t){return!co(t)||h(e,C({id:t.source.id}))&&h(e,C({id:t.target.id}))}));return t}(r(e));return t}function r(e){var t=gi(e,!0),n=t.flatMap((e=>(e.incoming||[]).concat(e.outgoing||[]))),i=t.concat(n);return[...new Set(i)]}function s(e,n){[xg,mg,vg,yg].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var s,a,l=e.context,c=l.shapes,u=l.allDraggedElements,h=o(c);if(!l.dragGroup){var d=Qn("g");jn(d,n.cls("djs-drag-group",["no-events"])),An(t.getActiveLayer(),d),l.dragGroup=d}h.forEach((function(e){i.addDragger(e,l.dragGroup)})),u?(s=[u,r(c)],u=Array.prototype.concat.apply([],s)):u=r(c),p(u,(function(e){t.addMarker(e,gg)})),l.allDraggedElements=u,l.differentParents=1!==(a=b(c,(function(e){return e.parent&&e.parent.id})),y(a).length)})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,o=t.shape.parent,r=t.canExecute;i&&("attach"===r?s(i,xg):t.canExecute&&o&&i.id!==o.id?s(i,yg):s(i,t.canExecute?mg:vg)),Fo(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context.target;t&&s(t,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,o=n.dragGroup;p(i,(function(e){t.removeMarker(e,gg)})),o&&ti(o)})),this.makeDraggable=function(e,n,o){i.addDragger(n,e.dragGroup),o&&t.addMarker(n,gg),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}bg.$inject=["eventBus","canvas","styles","previewSupport"];var _g={__depends__:[Oa,Aa,dg,gc,uc,Cu],__init__:["move","movePreview"],move:["type",fg],movePreview:["type",bg]};const wg={width:135,height:46},Cg={width:100,height:63};function Og(e,t,n){return Qn("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function kg(e,t){this._styles=t,e.registerProvider(this)}function Eg(e,t){var n;return"dmn:BusinessKnowledgeModel"===t?n=wg:"dmn:KnowledgeSource"===t&&(n=Cg),e.width===n.width&&e.height===n.height}kg.$inject=["outline","styles"],kg.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;return hn(e,"dmn:InputData")?jn(n=Qn("rect"),M({x:-5,y:-5,rx:27,width:e.width+10,height:e.height+10},t)):hn(e,"dmn:BusinessKnowledgeModel")&&Eg(e,"dmn:BusinessKnowledgeModel")?n=Og("\nM2.45221 16.0068L18.7175 1.74436L18.0615 0.996331L18.7175 1.74436C19.2646 1.26455 19.9676 \n1 20.6953 1H140.926C142.583 1 143.926 2.34295 143.926 3.99967L143.93 37.5457C143.93 \n38.3668 143.593 39.152 142.999 39.7183L143.689 40.4424L142.999 39.7183L127.299 \n54.6723C126.741 55.2036 126 55.5 125.23 55.5H4.53787C2.88599 55.5 1.54491 54.1646 1.5379 \n52.5127L1.43066 27.229L1.43065 27.2248L1.4301 18.2626C1.43005 \n17.3986 1.80255 16.5765 2.45221 16.0068Z\n",{x:-6,y:-6},t):hn(e,"dmn:KnowledgeSource")&&Eg(e,"dmn:KnowledgeSource")&&(n=Og("\nM1.79494 63.0032L1.2941 63.6423L1.79493 63.0032C1.71778 62.9427 1.6428 62.8741 1.57288 \n62.8L1.01736 63.3241L1.57288 62.8C1.20495 62.41 1 61.8941 1 61.3579V2.65067C1 1.74066 \n1.73867 1.00345 2.64868 1.00526L108.006 1.2145C109.66 1.21778 111 2.55996 111 \n4.21449V21.7015V61.6762C111 63.3188 109.679 64.656 108.037 64.676L107.06 64.6879C106.66 \n64.6927 106.26 64.6165 105.89 64.4652C105.04 64.1176 104.222 63.78 103.43 \n63.4531C93.4866 59.3517 87.6891 56.9603 76.3991 58.1057C71.7035 58.5821 66.8747 60.74 \n61.5721 63.1744C61.3243 63.2881 61.0753 63.4026 60.825 63.5177C55.6712 65.8868 49.9696 \n68.5077 43.2365 70.3468C31.101 73.6617 15.2135 73.5179 1.79494 63.0032Z\n",{x:-6,y:-1.5},t)),n},kg.prototype.updateOutline=function(e){return!!gn(e,["dmn:InputData","dmn:BusinessKnowledgeModel","dmn:KnowledgeSource"])};var Sg={__depends__:[dg],__init__:["outlineProvider"],outlineProvider:["type",kg]},Rg=".djs-palette-toggle",Tg=".entry",Mg=Rg+", "+Tg,Ag="djs-palette-",Pg="open",Dg="two-column";function $g(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function jg(e,t){var n=t.getPaletteEntries();return l(n)?n(e):(p(n,(function(t,n){e[n]=t})),e)}$g.$inject=["eventBus","canvas"],$g.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},$g.prototype.getEntries=function(){return this._getProviders().reduce(jg,{})},$g.prototype._rebuild=function(){this._diagramInitialized&&(this._getProviders().length&&(this._container||this._init(),this._update()))},$g.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Gt($g.HTML_MARKUP);n.appendChild(i),$t(n).add(Ag+"shown"),Wt.bind(i,Mg,"click",(function(t){if(Yt(t.delegateTarget,Rg))return e.toggle();e.trigger("click",t)})),zt.bind(i,"mousedown",(function(e){e.stopPropagation()})),Wt.bind(i,Tg,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},$g.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},$g.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,o=this._eventBus,r=$t(i),s=$t(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),r.toggle(Dg,t),s.toggle(Ag+Dg,t),"open"in e&&(r.toggle(Pg,e.open),s.toggle(Ag+Pg,e.open)),o.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},$g.prototype._update=function(){var e=Zt(".djs-palette-entries",this._container),t=this._entries=this.getEntries();It(e),p(t,(function(t,n){var i=t.group||"default",o=Zt("[data-group="+al(i)+"]",e);o||(Pt(o=Gt('<div class="group"></div>'),"data-group",i),e.appendChild(o));var s=t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),a=Gt(s);if(o.appendChild(a),!t.separator&&(Pt(a,"data-action",n),t.title&&Pt(a,"title",t.title),t.className&&function(e,t){var n=$t(e),i=r(t)?t:t.split(/\s+/g);i.forEach((function(e){n.add(e)}))}(a,t.className),t.imageUrl)){var l=Gt("<img>");Pt(l,"src",t.imageUrl),a.appendChild(l)}})),this.open()},$g.prototype.trigger=function(e,t,n){var i,o,r=t.delegateTarget||t.target;return r?(i=Pt(r,"data-action"),o=t.originalEvent||t,this.triggerEntry(i,e,o,n)):t.preventDefault()},$g.prototype.triggerEntry=function(e,t,n,i){var o,r;if((o=this._entries[e])&&(r=o.action,!1!==this._eventBus.fire("palette.trigger",{entry:o,event:n}))){if(l(r)){if("click"===t)return r(n,i)}else if(r[t])return r[t](n,i);n.preventDefault()}},$g.prototype._layoutChanged=function(){this._toggleState({})},$g.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},$g.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},$g.prototype.open=function(){this._toggleState({open:!0})},$g.prototype.toggle=function(){this.isOpen()?this.close():this.open()},$g.prototype.isActiveTool=function(e){return e&&this._activeTool===e},$g.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Zt(".djs-palette-entries",this._container),this._toolsContainer=Zt("[data-group=tools]",t)),p(this._toolsContainer.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=$t(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},$g.prototype.isOpen=function(){return $t(this._container).has(Pg)},$g.prototype._getParentContainer=function(){return this._canvas.getContainer()},$g.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';var Ig={__init__:["palette"],palette:["type",$g]};function Bg(e){this._eventBus=e,this._tools=[],this._active=null}Bg.$inject=["eventBus"],Bg.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},Bg.prototype.isActive=function(e){return e&&this._active===e},Bg.prototype.length=function(e){return this._tools.length},Bg.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Bg.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",(function(t){t.context.reactivate||!this.isActive(e)?this.setActive(e):this.setActive(null)}),this),p(t,(function(e){i.push(e+".ended"),i.push(e+".canceled")})),n.on(i,250,(function(e){this._active&&(function(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Bt(t,'.group[data-group="tools"]')}(e)||this.setActive(null))}),this)};var Lg={__depends__:[uc],__init__:["toolManager"],toolManager:["type",Bg]};function Ng(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){(t._svg=e.svg).addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}Ng.$inject=["eventBus"],Ng.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,o=t,r=e,s=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,o,r,s,!1,!1,!1,!1,0,null);return n}(0,0)};var qg={__init__:["mouse"],mouse:["type",Ng]},Vg="crosshair";function Fg(e,t,n,i,o,r,s){this._selection=o,this._dragging=n,this._mouse=s;var a=this,l=function(e){var n,i=t.getActiveLayer();jn(n=e.frame=Qn("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),An(i,n)},c=function(e){var t=e.frame,n=e.bbox;jn(t,{x:n.x,y:n.y,width:n.width,height:n.height})},u=function(e){e.frame&&ti(e.frame)};r.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){a.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",0,(function(e){var t=e.context,n=zg(e),o=i.filter((function(e){return e})),r=ba(e);a.select(o,n,r?t.selection:[])})),e.on("lasso.start",(function(e){var t=e.context;t.bbox=zg(e),l(t),t.selection=o.get()})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=zg(e),c(t)})),e.on("lasso.cleanup",(function(e){var t=e.context;u(t)})),e.on("element.mousedown",1500,(function(e){if(ba(e))return a.activateLasso(e.originalEvent),!0}))}function zg(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}Fg.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Fg.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Vg,data:{context:{}}})},Fg.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Vg,data:{context:{}},keepSelection:!0})},Fg.prototype.select=function(e,t,n=[]){var i=function(e,t){var n={};return p(e,(function(e){var i=e;i.waypoints&&(i=mi(i)),!a(t.y)&&i.x>t.x&&(n[e.id]=e),!a(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(a(t.width)&&a(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:a(t.width)&&a(t.height)||(n[e.id]=e))})),n}(e,t);this._selection.select([...n,...x(i)])},Fg.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Fg.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var Qg={__depends__:[Lg,qg],__init__:["lassoTool"],lassoTool:["type",Fg]},Hg=1500,Wg="grab";function Ug(e,t,n,i,o,r){this._dragging=n,this._mouse=r;var s=this,a=i.get("keyboard",!1);o.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Hg,(function(e){if(xa(e))return s.activateMove(e.originalEvent,!0),!1})),a&&a.addListener(Hg,(function(e){if(Xg(e.keyEvent)&&!s.isActive()){var t=s._mouse.getLastMoveEvent();s.activateMove(t,!!t)}}),"keyboard.keydown"),a&&a.addListener(Hg,(function(e){Xg(e.keyEvent)&&s.isActive()&&s.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",(function(){s.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context.reactivate;return!xa(t)&&n&&e.once("hand.move.ended",(function(e){s.activateHand(e.originalEvent,!0,!0)})),!1}))}function Xg(e){return fl("Space",e)}Ug.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Ug.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Wg,data:{context:n||{}}})},Ug.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Wg,data:{context:{reactivate:n}}})},Ug.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},Ug.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var Kg={__depends__:[Lg,qg],__init__:["handTool"],handTool:["type",Ug]};function Gg(e,t,n,i,o,r){this._palette=e,this._create=t,this._elementFactory=n,this._handTool=i,this._lassoTool=o,this._translate=r,e.registerProvider(this)}Gg.$inject=["palette","create","elementFactory","handTool","lassoTool","translate"],Gg.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,o=this._handTool,r=this._lassoTool,s=this._translate;function a(e,t,o,r,s){function a(t){var o=i.createShape(M({type:e},s));n.start(t,o)}return{group:t,className:o,title:r,action:{dragstart:a,click:a}}}return M(t,{"hand-tool":{group:"tools",className:"dmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"dmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"tool-separator":{group:"tools",separator:!0},"create.decision":a("dmn:Decision","drd","dmn-icon-decision",s("Create decision")),"create.input-data":a("dmn:InputData","drd","dmn-icon-input-data",s("Create input data")),"create.knowledge-source":a("dmn:KnowledgeSource","drd","dmn-icon-knowledge-source",s("Create knowledge source")),"create.business-knowledge-model":a("dmn:BusinessKnowledgeModel","drd","dmn-icon-business-knowledge",s("Create knowledge model"))}),t};var Yg={__depends__:[ha,Ig,zu,Qg,Kg],__init__:["paletteProvider"],paletteProvider:["type",Gg]},Zg=Math.max,Jg=Math.min,em=20;function tm(e,t,n){var i=t[e],o=n.min&&n.min[e],r=n.max&&n.max[e];return a(o)&&(i=(/top|left/.test(e)?Jg:Zg)(i,o)),a(r)&&(i=(/top|left/.test(e)?Zg:Jg)(i,r)),i}function nm(e,t){return void 0!==e?e:em}function im(e){return!e.waypoints&&"label"!==e.type}function om(e,t){var n;if((n=void 0===e.length?d(e.children,im):e).length)return function(e,t){var n,i,o,r;return"object"==typeof t?(n=nm(t.left),i=nm(t.right),o=nm(t.top),r=nm(t.bottom)):n=i=o=r=nm(t),{x:e.x-n,y:e.y-o,width:e.width+n+i,height:e.height+o+r}}(mi(n),t)}function rm(e,t,n,i){this._dragging=i,this._rules=t;var o=this;function r(e,t){var n,i=e.shape,r=e.direction,s=e.resizeConstraints;e.delta=t,n=function(e,t,n){var i=n.x,o=n.y,r={x:e.x,y:e.y,width:e.width,height:e.height};return-1!==t.indexOf("n")?(r.y=e.y+o,r.height=e.height-o):-1!==t.indexOf("s")&&(r.height=e.height+o),-1!==t.indexOf("e")?r.width=e.width+i:-1!==t.indexOf("w")&&(r.x=e.x+i,r.width=e.width-i),r}(i,r,t),e.newBounds=function(e,t){if(!t)return e;var n=po(e);return fo({top:tm("top",n,t),right:tm("right",n,t),bottom:tm("bottom",n,t),left:tm("left",n,t)})}(n,s),e.canExecute=o.canResize(e)}function s(e){var t,i=e.shape,o=e.canExecute,r=e.newBounds;if(o){if(t=r,!function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(i,r={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}))return;n.resizeShape(i,r)}}e.on("resize.start",(function(e){var t,n,i;t=e.context,n=t.resizeConstraints,i=t.minBounds,void 0===n&&(void 0===i&&(i=o.computeMinResizeBox(t)),t.resizeConstraints={min:po(i)})})),e.on("resize.move",(function(e){var t={x:e.dx,y:e.dy};r(e.context,t)})),e.on("resize.end",(function(e){s(e.context)}))}function sm(e,t){var n=mo(e),i=po(e),o={x:n.x,y:n.y};return-1!==t.indexOf("n")?o.y=i.top:-1!==t.indexOf("s")&&(o.y=i.bottom),-1!==t.indexOf("e")?o.x=i.right:-1!==t.indexOf("w")&&(o.x=i.left),o}function am(e){var t="resize-";return"n"===e||"s"===e?t+"ns":"e"===e||"w"===e?t+"ew":"nw"===e||"se"===e?t+"nwse":t+"nesw"}rm.prototype.canResize=function(e){var t=this._rules,n=A(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},rm.prototype.activate=function(e,t,n){var i,o,r=this._dragging;if("string"==typeof n&&(n={direction:n}),!(o=(i=M({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,sm(t,o),"resize",{autoActivate:!0,cursor:am(o),data:{shape:t,context:i}})},rm.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(e,t,n,i){var o=po(t),r={top:/n/.test(e)?o.bottom-n.height:o.top,left:/w/.test(e)?o.right-n.width:o.left,bottom:/s/.test(e)?o.top+n.height:o.bottom,right:/e/.test(e)?o.left+n.width:o.right},s=i?po(i):r;return fo({top:Jg(r.top,s.top),left:Jg(r.left,s.left),bottom:Zg(r.bottom,s.bottom),right:Zg(r.right,s.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},om(t,e.childrenBoxPadding))},rm.$inject=["eventBus","rules","modeling","dragging"];var lm="djs-resizing",cm="resize-not-ok";function um(e,t,n){e.on("resize.move",500,(function(e){var i,o,r,s;i=e.context,o=i.shape,r=i.newBounds,(s=i.frame)||(s=i.frame=n.addFrame(o,t.getActiveLayer()),t.addMarker(o,lm)),r.width>5&&jn(s,{x:r.x,width:r.width}),r.height>5&&jn(s,{y:r.y,height:r.height}),i.canExecute?Bn(s).remove(cm):Bn(s).add(cm)})),e.on("resize.cleanup",(function(e){var n,i;n=e.context,i=n.shape,n.frame&&ti(n.frame),t.removeMarker(i,lm)}))}um.$inject=["eventBus","canvas","previewSupport"];var hm=-6,dm="djs-resizer",pm=["n","w","s","e","nw","ne","se","sw"];function fm(e,t,n,i){this._resize=i,this._canvas=t;var o=this;e.on("selection.changed",(function(e){var t=e.newSelection;o.removeResizers(),1===t.length&&p(t,T(o.addResizer,o))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(o.removeResizers(),o.addResizer(t))}))}fm.prototype.makeDraggable=function(e,t,n){var i=this._resize;function o(t){ya(t)&&i.activate(t,e,n)}zt.bind(t,"mousedown",o),zt.bind(t,"touchstart",o)},fm.prototype._createResizer=function(e,t,n,i){var o=this._getResizersParent(),r=function(e){var t={x:0,y:0};-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=hm);-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=hm);return t}(i),s=Qn("g");Bn(s).add(dm),Bn(s).add(dm+"-"+e.id),Bn(s).add(dm+"-"+i),An(o,s);var a=Qn("rect");jn(a,{x:-4+r.x,y:-4+r.y,width:8,height:8}),Bn(a).add(dm+"-visual"),An(s,a);var l=Qn("rect");return jn(l,{x:-10+r.x,y:-10+r.y,width:20,height:20}),Bn(l).add(dm+"-hit"),An(s,l),function(e,t,n,i,o){var r=Xn();r.setTranslate(t,n);var s=Xn();s.setRotate(0,0,0);var a=Xn();a.setScale(1,1),ii(e,[r,s,a])}(s,t,n),s},fm.prototype.createResizer=function(e,t){var n=sm(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},fm.prototype.addResizer=function(e){var t=this;!co(e)&&this._resize.canResize({shape:e})&&p(pm,(function(n){t.createResizer(e,n)}))},fm.prototype.removeResizers=function(){Nn(this._getResizersParent())},fm.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},fm.$inject=["eventBus","canvas","selection","resize"];var gm={__depends__:[gc,uc,Cu],__init__:["resize","resizePreview","resizeHandles"],resize:["type",rm],resizePreview:["type",um],resizeHandles:["type",fm]};function mm(e){e.on(["bendpoint.move.move","bendpoint.move.end"],2e3,(function(e){var t=e.context,n=t.allowed,i=t.hover,o=t.source,r=t.target,s=t.type;if(t.hints||(t.hints={}),delete t.hints.connectionStart,delete t.hints.connectionEnd,(!n||"dmn:InformationRequirement"===n.type)&&i&&gn(i,["dmn:Decision","dmn:InputData"])&&o!==r){var a="reconnectStart"===s||"reconnectEnd"===s,l=vo(o,r);a&&i===o?(!function(e,t){var n=e.context,i=n.source,o=vm(i,t),r=e.x-o.x,s=e.y-o.y;e.x-=r,e.y-=s,e.dx-=r,e.dy-=s}(e,l),t.hints.connectionEnd=ym(r,l)):a&&i===r&&(t.hints.connectionStart=vm(o,l),function(e,t){var n=e.context,i=n.target,o=ym(i,t),r=0,s=0;t.includes("top")||t.includes("bottom")?s=e.y-o.y:r=e.x-o.x;e.x-=r,e.y-=s,e.dx-=r,e.dy-=s}(e,l))}}))}function vm(e,t){var n=po(e),i=mo(e);return t.includes("bottom")?i.y=n.top:t.includes("top")?i.y=n.bottom:t.includes("right")?i.x=n.left:i.x=n.right,i}function ym(e,t){var n=po(e),i=mo(e);return t.includes("bottom")?i.y=n.bottom:t.includes("top")?i.y=n.top:t.includes("right")?i.x=n.right:i.x=n.left,i}mm.$inject=["eventBus"];function xm(e){e.on(["connect.hover","connect.move","connect.end"],250,(function(e){var t=e.context,n=t.canExecute,i=t.hover,o=t.source,r=t.target;if(n&&"dmn:InformationRequirement"===n.type){var s=vo(o,r);t.connectionStart=mo(o),t.connectionEnd=i===o?mo(r):{x:e.x,y:e.y},s.includes("bottom")?(t.connectionStart.y=po(o).top,t.connectionEnd.y=po(r).bottom):s.includes("top")?(t.connectionStart.y=po(o).bottom,t.connectionEnd.y=po(r).top):s.includes("right")?(t.connectionStart.x=po(o).left,t.connectionEnd.x=po(r).right):(t.connectionStart.x=po(o).right,t.connectionEnd.x=po(r).left)}else delete t.connectionStart,delete t.connectionEnd}))}function bm(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function _m(){this._snapValues={}}xm.$inject=["eventBus"],bm.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},bm.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},bm.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},bm.prototype.getSnapLocations=function(){return this._snapLocations},bm.prototype.setSnapLocations=function(e){this._snapLocations=e},bm.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new _m).initDefaults(this._defaultSnaps),n},_m.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},_m.prototype.snap=function(e,t,n,i){var o=this._snapValues[t];return o&&function(e,t,n){var i,o;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(o=t[i],Yc(o-e)<=n)return o}(e[n],o[n],i)},_m.prototype.initDefaults=function(e){var t=this;p(e||{},(function(e,n){p(e,(function(e){t.add(n,e)}))}))};function wm(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],(function(e){i.initSnap(e)})),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,(function(e){var t=e.context,o=t.shape,r=t.snapContext,s=t.target;if((!e.originalEvent||!pl(e.originalEvent))&&!eu(e)&&s){var a=r.pointsForTarget(s);a.initialized||((a=i.addSnapTargetPoints(a,o,s)).initialized=!0),n.snap(e,a)}})),t.on(["create.cleanup","shape.move.cleanup"],(function(){n.hide()}))}wm.$inject=["elementRegistry","eventBus","snapping"],wm.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,o=i.shape,r=i.snapContext;r||(r=i.snapContext=new bm);var s=(t=n.get(o.id)?Jc(o,e):{x:e.x+Jc(o).x,y:e.y+Jc(o).y}).x-o.width/2,a=t.y-o.height/2,l=t.x+o.width/2,c=t.y+o.height/2;return r.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),uo(o)||(r.setSnapOrigin("top-left",{x:s-e.x,y:a-e.y}),r.setSnapOrigin("bottom-right",{x:l-e.x,y:c-e.y})),r},wm.prototype.addSnapTargetPoints=function(e,t,n){return p(this.getSnapTargets(t,n),(function(n){if(uo(n))uo(t)&&e.add("mid",Jc(n));else if(co(n)){if(n.waypoints.length<3)return;p(n.waypoints.slice(1,-1),(function(t){e.add("mid",t)}))}else e.add("mid",Jc(n))})),a(t.x)&&a(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",Jc(t)),e):e},wm.prototype.getSnapTargets=function(e,t){return nu(t).filter((function(e){return!e.hidden}))};function Cm(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=e.context,o=i.shape,r=o.parent,s=i.direction,a=i.snapContext;if(!(e.originalEvent&&pl(e.originalEvent)||eu(e))){var l=a.pointsForTarget(r);l.initialized||((l=n.addSnapTargetPoints(l,o,r,s)).initialized=!0),function(e){return"n"===e||"s"===e}(s)&&tu(e,"x",e.x),function(e){return"e"===e||"w"===e}(s)&&tu(e,"y",e.y),t.snap(e,l)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function Om(e,t){var n=mo(e),i=po(e),o={x:n.x,y:n.y};return-1!==t.indexOf("n")?o.y=i.top:-1!==t.indexOf("s")&&(o.y=i.bottom),-1!==t.indexOf("e")?o.x=i.right:-1!==t.indexOf("w")&&(o.x=i.left),o}Cm.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,o=t.snapContext;o||(o=t.snapContext=new bm);var r=Om(n,i);return o.setSnapOrigin("corner",{x:r.x-e.x,y:r.y-e.y}),o},Cm.prototype.addSnapTargetPoints=function(e,t,n,i){return p(this.getSnapTargets(t,n),(function(t){var n;e.add("corner",{x:(n=t).x+n.width,y:n.y+n.height}),e.add("corner",function(e){return{x:e.x,y:e.y}}(t))})),e.add("corner",Om(t,i)),e},Cm.$inject=["eventBus","snapping"],Cm.prototype.getSnapTargets=function(e,t){return nu(t).filter((function(t){return!(n=t,i=e,n.host===i||co(t)||function(e){return!!e.hidden}(t)||uo(t));var n,i}))};function km(e){this._canvas=e,this._asyncHide=R(T(this.hide,this),1e3)}km.$inject=["canvas"],km.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),o={x:eu(e,"x"),y:eu(e,"y")};p(i,(function(i){var r=n.getSnapOrigin(i),s={x:e.x+r.x,y:e.y+r.y};if(p(["x","y"],(function(e){var n;o[e]||void 0!==(n=t.snap(s,i,e,7))&&(o[e]={value:n,originValue:n-r[e]})})),o.x&&o.y)return!1})),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),p(["x","y"],(function(t){var n=o[t];s(n)&&tu(e,t,n.originValue)}))},km.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Qn("path");return jn(n,{d:"M0,0 L0,0"}),Bn(n).add("djs-snap-line"),An(t,n),{update:function(t){a(t)?jn(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):jn(n,{display:"none"})}}},km.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},km.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},km.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},km.prototype.hide=function(){p(this._snapLines,(function(e){e.update()}))};var Em={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",wm],resizeSnapping:["type",Cm],snapping:["type",km]}],__init__:["bendpointSnapping","connectSnapping"],bendpointSnapping:["type",mm],connectSnapping:["type",xm]};function Sm(e){Sl.call(this,e)}function Rm(e,t){jm(e,"dmn:Decision")?function(e,t){for(const n of e.get("informationRequirement"))Tm(n,t);for(const n of e.get("knowledgeRequirement"))Am(n,t)}(e,t):jm(e,"dmn:BusinessKnowledgeModel")?function(e,t){for(const n of e.get("knowledgeRequirement"))Am(n,t)}(e,t):jm(e,"dmn:Expression")&&function(e,t){jm(e,"dmn:FunctionDefinition")&&function(e,t){const n=e.get("formalParameter");for(const e of n)Pm(e,t)}(e,t)}(e,t)}function Tm(e,t){const n=e.get("requiredInput");n&&function(e,t){const n=$m(e,t.rootElement);if(!n)return;const i=n.get("name");if(!i)return;t.variables.push({name:i,origin:n})}(n,t);const i=e.get("requiredDecision");i&&function(e,t){const n=$m(e,t.rootElement);if(!n)return;const i=n.get("name");if(!i)return;const o={name:i,origin:n},r=n.get("decisionLogic");r&&function(e,t,n){if(jm(e,"dmn:DecisionTable")){!function(e,t,n){if(1===e.length){const n={...Mm(e[0]),name:t.name};return void Object.assign(t,n)}const i=e.map(Mm);t.entries=i.filter((e=>!!e.name))}(e.get("output"),t)}}(r,o);t.variables.push(o)}(i,t)}function Mm(e){const t={name:e.name};return e.typeRef&&(t.detail=e.typeRef),t}function Am(e,t){const n=e.get("requiredKnowledge");n&&function(e,t){const n=$m(e,t.rootElement);if(!n)return;jm(n,"dmn:BusinessKnowledgeModel")&&function(e,t){const n=e.get("name");if(!n)return;const i={name:n,origin:e},o=e.get("encapsulatedLogic");o&&function(e,t,n){const i=e.get("formalParameter"),o=i.map(((e,t)=>{const n={name:e.get("name")||`param ${t+1}`,type:e.get("typeRef")};return n.type||delete n.type,n}));Object.assign(t,{type:"function",params:o})}(o,i);t.variables.push(i)}(n,t)}(n,t)}function Pm(e,t){const n=e.get("name");if(!n)return;const i={name:n,origin:e};e.get("typeRef")&&(i.detail=e.get("typeRef")),t.variables.push(i)}function Dm(e){let t=e;for(;t.$parent;)t=t.$parent;return t}function $m(e,t){const n=e.get("href");if(!n||!n.startsWith("#"))return;const i=n.slice(1);return t.get("drgElement").find((e=>e.get("id")===i))}function jm(e,t){return e.$instanceOf(t)}yn(Sm,Sl),Sm.prototype._modelingModules=[Dl,ic,pc,su,_d,Cd,Md,jd,Vd,Qd,ep,lp,hp,xp,Dp,cg,_g,Sg,Yg,gm,Em],Sm.prototype._modules=[].concat(Sm.prototype._modules,Sm.prototype._modelingModules);class Im{constructor(e){e.registerProvider(this)}getVariables(e,t){return e.concat(function(e){const t={variables:[],rootElement:Dm(e)};for(let n=e;n;n=n.$parent)Rm(n,t);return t.variables}(t))}}Im.$inject=["variableResolver"];const Bm={__init__:["dmnVariableProvider"],dmnVariableProvider:["type",Im],variableResolver:["type",class{constructor(){this._providers=[]}registerProvider(e){this._providers.push(e)}getVariables(e){return this._providers.reduce(((t,n)=>n.getVariables(t,e)),[])}}]};class Lm{constructor(e){M(this,e),zm(this,"businessObject",{writable:!0})}}class Nm extends Lm{constructor(e){super(e),zm(this,"root",{writable:!0}),zm(this,"cells",{enumerable:!0,value:this.cells||[]})}}class qm extends Lm{constructor(e){super(e),zm(this,"root",{writable:!0}),zm(this,"cells",{enumerable:!0,value:this.cells||[]})}}class Vm extends Lm{constructor(e){super(e),zm(this,"row",{writable:!0}),zm(this,"col",{writable:!0})}}const Fm={root:class extends Lm{constructor(e){super(e),zm(this,"rows",{enumerable:!0,value:this.rows||[]}),zm(this,"cols",{enumerable:!0,value:this.cols||[]})}},row:Nm,col:qm,cell:Vm};function zm(e,t,n){Object.defineProperty(e,t,n)}let Qm=class{constructor(){this._uid=12}create(e,t={}){return t.id||(t.id=e+"_"+this._uid++),function(e,t){const n=Fm[e];if(!n)throw new Error("unknown type "+e);return new n(t)}(e,t)}createRoot(e){return this.create("root",e)}createRow(e){return this.create("row",e)}createCol(e){return this.create("col",e)}createCell(e){return this.create("cell",e)}},Hm=class{constructor(e){this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}add(e,t){const{id:n}=e;this._elements[n]=e}remove(e){const t=e.id||e;delete this._elements[t]}get(e){return this._elements[e]}getAll(){return Wm(this._elements)}forEach(e){Wm(this._elements).forEach((t=>e(t)))}filter(e){return Wm(this._elements).filter((t=>e(t)))}clear(){this._elements={}}updateId(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}_validateId(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}};function Wm(e){return Object.keys(e).map((function(t){return e[t]}))}Hm.$inject=["eventBus"];let Um=class{constructor(e){this._listeners={},e.on("elements.changed",(({elements:e})=>{this.elementsChanged(e)})),e.on("root.remove",(t=>{const n=t.root.id;this._listeners[n]&&e.once("root.add",(e=>{const t=e.root.id;this.updateId(n,t)}))})),e.on("element.updateId",(({element:e,newId:t})=>{this.updateId(e.id,t)}))}elementsChanged(e){const t={},n=e.length;for(let i=0;i<n;i++){const{id:n}=e[i];if(t[n])return;t[n]=!0;const o=this._listeners[n]&&this._listeners[n].length;if(o)for(let e=0;e<o;e++)this._listeners[n][e]&&this._listeners[n][e]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){const n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}};Um.$inject=["eventBus"];class Xm extends Ds{constructor(e){super(e);const t=this._injector=e.injector;this._sheet=t.get("sheet"),this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._eventBus=t.get("eventBus");const n=t.get("throttle");this.onElementsChanged=this.onElementsChanged.bind(this),this.onScroll=n(this.onScroll.bind(this))}onElementsChanged(){this.forceUpdate()}onScroll(){this._eventBus.fire("sheet.scroll")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}componentWillMount(){const{id:e}=this._sheet.getRoot();this._changeSupport.onElementsChanged(e,this.onElementsChanged)}componentWillUnmount(){const{id:e}=this._sheet.getRoot();this._changeSupport.offElementsChanged(e,this.onElementsChanged)}render(){const{rows:e,cols:t}=this._sheet.getRoot(),n=this._components.getComponents("table.before"),i=this._components.getComponents("table.after"),o=this._components.getComponent("table.head"),r=this._components.getComponent("table.body"),s=this._components.getComponent("table.foot");return vr(1,"div","tjs-container",[n&&n.map(((e,t)=>yr(2,e,null,t))),vr(1,"div","tjs-table-container",vr(1,"table","tjs-table",[o&&yr(2,o,{rows:e,cols:t}),r&&yr(2,r,{rows:e,cols:t}),s&&yr(2,s,{rows:e,cols:t})],0),2,{onScroll:this.onScroll}),i&&i.map(((e,t)=>yr(2,e,null,t)))],0)}}let Km=class{constructor(e,t,n,i,o){const{container:r}=n;this._container=r,i.on("root.added",(()=>{Rs(yr(2,Xm,{injector:o}),r)})),i.on("root.remove",(()=>{Rs(null,r)}))}getContainer(){return this._container}};Km.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var Gm={__init__:["changeSupport","components","renderer"],changeSupport:["type",Um],components:["type",class{constructor(){this._listeners={}}getComponent(e,t){const n=this._listeners[e];if(!n)return;let i;for(let e=0;e<n.length&&(i=n[e].callback(t),!i);e++);return i}getComponents(e,t){const n=this._listeners[e],i=[];if(!n)return i;for(let e=0;e<n.length;e++){const o=n[e].callback(t);o&&i.push(o)}return i.length,i}onGetComponent(e,t,n){if(l(t)&&(n=t,t=1e3),!a(t))throw new Error("priority must be a number");const i=this._getListeners(e);let o,r;const s={priority:t,callback:n};for(r=0;o=i[r];r++)if(o.priority<t)return void i.splice(r,0,s);i.push(s)}offGetComponent(e,t){const n=this._getListeners(e);let i,o,r;if(t)for(r=n.length-1;i=n[r];r--)o=i.callback,o===t&&n.splice(r,1);else n.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}],renderer:["type",Km]};class Ym{constructor(e,t){this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",(()=>{this.setRoot(null)}))}setRoot(e){if(this._root){const e=this._root;this._eventBus.fire("root.remove",{root:e}),this._root=null,this._eventBus.fire("root.removed",{root:e})}e&&this._eventBus.fire("root.add",{root:e}),this._root=e,e&&this._eventBus.fire("root.added",{root:e})}getRoot(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}addRow(e,t){const n=this.getRoot();if(n.cols.length!=e.cells.length)throw new Error("number of cells is not equal to number of cols");return void 0===t&&(t=n.rows.length),Zm(t,n.rows,e),e.root=n,this._elementRegistry.add(e),e.cells.forEach(((i,o)=>{this._elementRegistry.add(i),i.row=e,i.col=n.cols[o],Zm(t,n.cols[o].cells,i)})),this._eventBus.fire("row.add",{row:e}),e}removeRow(e){const t=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));const n=t.rows.indexOf(e);-1!==n&&(Jm(n,t.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(((e,i)=>{this._elementRegistry.remove(e),e.col=void 0,Jm(n,t.cols[i].cells)})),this._eventBus.fire("row.remove",{row:e}))}addCol(e,t){const n=this.getRoot();if(this._elementRegistry.add(e),n.rows.length!=e.cells.length)throw new Error("number of cells is not equal to number of rows");return void 0===t&&(t=n.cols.length),Zm(t,n.cols,e),e.root=n,e.cells.forEach(((i,o)=>{this._elementRegistry.add(i),i.col=e,i.row=n.rows[o],Zm(t,n.rows[o].cells,i)})),this._eventBus.fire("col.add",{col:e}),e}removeCol(e){const t=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));const n=t.cols.indexOf(e);-1!==n&&(Jm(n,t.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(((e,i)=>{this._elementRegistry.remove(e),e.row=void 0,Jm(n,t.rows[i].cells)})),this._eventBus.fire("col.remove",{col:e}))}resized(){this._eventBus.fire("sheet.resized")}}function Zm(e,t,n){return t.splice(e,0,n)}function Jm(e,t){return t.splice(e,1)}function ev(e=!0){const t="number"==typeof e?e:e?300:0;return t?e=>function(e,t){let n=!1;return function(...i){n||(e(...i),n=!0,setTimeout((()=>{n=!1}),t))}}(e,t):e=>e}Ym.$inject=["elementRegistry","eventBus"],ev.$inject=["config.throttle"];var tv={__depends__:[Gm],__init__:["elementFactory","sheet"],elementFactory:["type",Qm],elementRegistry:["type",Hm],eventBus:["type",j],sheet:["type",Ym],throttle:["factory",ev]};class nv{constructor(e={}){let{injector:t}=e;if(!t){let{modules:n,config:i}=this._init(e);t=function(e,t){const n=[{config:["value",e]},tv].concat(t||[]),i=new Sn(n);return i.init(),i}(i,n)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}_init(e){let{modules:t,...n}=e;return{modules:t,config:n}}destroy(){const e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}clear(){const e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}}function iv(e){if(!e)return"<null>";const t=e.id?` id="${e.id}"`:"";return`<${e.$type}${t} />`}function ov(e,t){function n(t,n,i){if(t.gfx)throw new Error(`already rendered ${iv(t)}`);return e.element(t,n,i)}function i(e,t,i){p(e,(function(e){n(e,t,i)}))}function o(e,t,i){p(e,(function(e){n(e,t,i)}))}return{handleDecision:function(t){t.id||(t.id="decision");const r=t.decisionLogic;if(!r)throw new Error(`no table for ${iv(t)}`);{if(!r.output)throw new Error(`missing output for ${iv(r)}`);const t=(c=r,e.table(c));r.input&&i(r.input,t,r),i(r.output,t,r),s=r.rule,a=t,l=r,p(s,(function(e){n(e,a,l),o(e.inputEntry,e),o(e.outputEntry,e)}))}var s,a,l,c}}}function rv(e,t){const{elements:n,index:i}=e;return i[t]?e:{elements:[...n,t],index:{...i,[t]:!0}}}function sv(...e){let t={elements:[],index:{}};return e.forEach((function(e){const n=typeof e;"string"===n&&e.length>0?t=rv(t,e):"object"===n&&null!==e&&Object.keys(e).forEach((function(n){e[n]&&(t=rv(t,n))}))})),function(e,t){return e.elements.join(t)}(t," ")}function av(e){return lv(e.constructor,e)}function lv(e,t){const n=e.$inject;if(!n)return;const{injector:i}=t.context,o=[...n,function(...e){for(const i in e){const o=n[i],r=e[i];t[o]=r}}];i.invoke(o)}function cv(e,t){Object.keys(t).forEach((function(n){if("$inject"===n||"__init"===n)return;const i=t[n];"constructor"===n&&i.call(e,e.props,e.context);const o=e[n];if(void 0!==o){if("function"!=typeof o)throw new Error(`failed to mixin <${n}>: cannot combine with non-fn component value`);e[n]=function(e,...t){return function(...n){let i;return t.forEach((function(t){if(i=t.call(e,...n),void 0!==i)return!1})),i}.bind(e)}(e,o,i)}else e[n]=i.bind(e)})),"$inject"in t&&lv(t,e),"__init"in t&&t.__init.call(e,e.props,e.context)}const uv={getSelectionClasses(){const{selected:e,selectedSecondary:t,focussed:n}=this.state;return sv({selected:e,"selected-secondary":t,focussed:n})},selectionChanged(e){this.setState(e)},componentWillUpdate(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount(){this.updateSelectionSubscription(!0)},componentWillUnmount(){this.updateSelectionSubscription(!1)},updateSelectionSubscription(e){const{elementId:t}=this.props;t&&t&&this.eventBus[e?"on":"off"](`selection.${t}.changed`,this.selectionChanged)},$inject:["eventBus"]};class hv extends Ds{constructor(e,t){super(e,t),cv(this,uv),av(this)}getRenderProps(...e){const{className:t,elementId:n,coords:i,...o}=this.props,r={className:sv(...e,this.getSelectionClasses(),t)};return n&&(r["data-element-id"]=n),i&&(r["data-coords"]=i),{...r,...o}}}class dv extends hv{constructor(e,t){super(e,t),this.state={}}render(){const{children:e}=this.props;return br(vr(1,"td",null,e,0,{...this.getRenderProps("cell")}))}}const pv={slotFill(e,t){const{type:n,context:i,...o}=e,r=this.components.getComponent(n,i)||t;return r?br(yr(2,r,{...i,...o})):null},slotFills(e){const{type:t,context:n,...i}=e;return this.components.getComponents(t,n).map((e=>br(yr(2,e,{...n,...i}))))},$inject:["components"]};class fv extends Ds{constructor(e,t){super(e,t),cv(this,pv),av(this)}componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot(),this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot(),this.onElementsChanged)}onElementsChanged=()=>{this.forceUpdate()};getRoot(){return this.sheet.getRoot()}render(){const e=(this.getRoot().businessObject.get("annotationsWidth")||400)+"px";return vr(1,"th","annotation header",[this.slotFills({type:"cell-inner",context:{cellType:"annotations",col:this.sheet.getRoot(),minWidth:400}}),this.translate("Annotations")],0,{style:{width:e}})}}function gv(e){const{row:t}=e,{id:n,description:i}=t.businessObject;return yr(2,dv,{className:"annotation",elementId:n,children:i||"-"})}function mv(e){e.onGetComponent("cell",(({cellType:e})=>"after-label-cells"===e?fv:"after-rule-cells"===e?gv:void 0))}fv.$inject=["changeSupport","sheet","translate"],mv.$inject=["components"];var vv={__init__:["annotationsProvider"],annotationsProvider:["type",mv]};function yv(e,t){return M({id:e.id,type:e.$type,businessObject:e},t)}class xv{constructor(e,t,n){this._elementFactory=e,this._eventBus=t,this._sheet=n}add(e){let t;if(hn(e,"dmn:DecisionTable"))t=this._elementFactory.createRoot(yv(e)),this._sheet.setRoot(t);else if(hn(e,"dmn:InputClause"))t=this._elementFactory.createCol(yv(e)),this._sheet.addCol(t);else if(hn(e,"dmn:OutputClause"))t=this._elementFactory.createCol(yv(e)),this._sheet.addCol(t);else if(hn(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);const n=[...e.inputEntry,...e.outputEntry].map((e=>this._elementFactory.createCell(yv(e))));t=this._elementFactory.createRow(M(yv(e),{cells:n})),this._sheet.addRow(t)}return this._eventBus.fire("dmnElement.added",{element:t}),t}}xv.$inject=["elementFactory","eventBus","sheet"];var bv={__depends__:[{__depends__:[ha],tableImporter:["type",xv]},Gm]};class _v extends Ds{constructor(e,t){super(e,t),cv(this,pv),this._sheet=t.injector.get("sheet"),this._changeSupport=t.changeSupport}onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}componentWillUnmount(){const e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}render(){const e=this._sheet.getRoot();if(!hn(e,"dmn:DMNElement"))return null;const t=fn(e),n=t.input,i=t.output;return vr(1,"thead",null,vr(1,"tr",null,[vr(1,"th","index-column"),this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),n&&n.map(((e,t)=>{const i=e.width||"192px";return this.slotFill({type:"cell",context:{cellType:"input-header",input:e,index:t,inputsLength:n.length,width:i},key:e.id},wv)})),i.map(((e,t)=>this.slotFill({type:"cell",context:{cellType:"output-header",output:e,index:t,outputsLength:i.length},key:e.id},Cv))),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),2)}}function wv(e,t){const{input:n,className:i,index:o}=e,{label:r,inputExpression:s,inputValues:a}=n,l=t.injector.get("translate");return vr(1,"th",(i||"")+" input-cell",[vr(1,"div","clause",l(0===o?"When":"And"),0),r?vr(1,"div","input-label",r,0,{title:l("Input label: ")+r}):vr(1,"div","input-expression",s.text,0,{title:l("Input expression: ")+s.text}),vr(1,"div","input-variable",a&&a.text||s.typeRef,0,{title:a&&a.text?l("Input values"):l("Input type")})],0,{"data-col-id":n.id},n.id)}function Cv(e,t){const{output:n,className:i,index:o}=e,{label:r,name:s,outputValues:a,typeRef:l}=n,c=t.injector.get("translate");return vr(1,"th",(i||"")+" output-cell",[vr(1,"div","clause",c(0===o?"Then":"And"),0),r?vr(1,"div","output-label",r,0,{title:c("Output label")}):vr(1,"div","output-name",s,0,{title:c("Output name")}),vr(1,"div","output-variable",a&&a.text||l,0,{title:a&&a.text?c("Output values"):c("Output type")})],0,null,n.id)}function Ov(e){e.onGetComponent("table.head",(()=>_v))}Ov.$inject=["components"];var kv={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",Ov]};let Ev=class extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),av(this)}render(){const e=this.sheet.getRoot();if(!hn(e,"dmn:DMNElement"))return null;const{name:t}=e.businessObject.$parent,n=this.components.getComponent("hit-policy")||Sv;return vr(1,"div","decision-table-properties",[vr(1,"div","decision-table-name",t,0,{title:this._translate("Decision name: ")+t}),vr(1,"div","decision-table-header-separator"),yr(2,n)],4)}};function Sv(){return null}Ev.$inject=["sheet","components"];let Rv=class{constructor(e){e.onGetComponent("table.before",500,(()=>Ev))}};Rv.$inject=["components"];var Tv={__init__:["decisionTableProperties"],decisionTableProperties:["type",Rv]};class Mv extends Ds{render(){const{row:e,rowIndex:t}=this.props,{components:n}=this.context,i=n.getComponents("cell-inner",{cellType:"rule-index",row:e,rowIndex:t});return vr(1,"td","rule-index",[i&&i.map((n=>yr(2,n,{row:e,rowIndex:t}))),t+1],0,{"data-element-id":e.id,"data-row-id":e.id})}}class Av{constructor(e){e.onGetComponent("cell",(({cellType:e})=>{if("before-rule-cells"===e)return Mv}))}}Av.$inject=["components"];var Pv={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",Av]};const Dv=[{label:"FEEL",value:"feel"}];class $v{constructor(e){this._injector=e;const t=e.get("config.expressionLanguages")||{};this._config={options:Dv,defaults:{editor:"feel"}},t.options&&(this._config.options=t.options);const n=this._getLegacyDefaults();M(this._config.defaults,n,t.defaults)}getDefault(e){const{defaults:t}=this._config,n=t[e]||t.editor;return this._getLanguageByValue(n)||this.getAll()[0]}getLabel(e){const t=this._getLanguageByValue(e);return t?t.label:e}getAll(){return this._config.options}_getLegacyDefaults(){const e={},t=this._injector,n=t.get("config.defaultInputExpressionLanguage"),i=t.get("config.defaultOutputExpressionLanguage");return n&&(e.inputCell=n),i&&(e.outputCell=i),e}_getLanguageByValue(e){return h(this.getAll(),(t=>e===t.value))}}$v.$inject=["injector"];var jv={__init__:["expressionLanguages"],expressionLanguages:["type",$v]};class Iv extends Ds{render({rows:e,cols:t}){const{components:n}=this.context;return vr(1,"tbody",null,e.map(((e,i)=>{const o=n.getComponent("row",{rowType:"rule"});return o&&yr(2,o,{row:e,rowIndex:i,cols:t},e.id)})),0)}}class Bv extends Ds{constructor(e,t){super(e,t),cv(this,pv)}render(){const{row:e,rowIndex:t,cols:n}=this.props,{cells:i}=e;return vr(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:e,rowIndex:t}}),i.map(((i,o)=>this.slotFill({type:"cell",context:{cellType:"rule",cell:i,rowIndex:t,colIndex:o},key:i.id,row:e,col:n[o]}))),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:e,rowIndex:t}})],0)}}class Lv extends Ds{render(){const{cell:e,row:t,col:n}=this.props;return hn(e,"dmn:UnaryTests")?yr(2,dv,{className:"input-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":n.id,children:e.businessObject.text}):yr(2,dv,{className:"output-cell",elementId:e.id,"data-row-id":t.id,"data-col-id":n.id,children:e.businessObject.text})}}let Nv=class{constructor(e){e.onGetComponent("table.body",(()=>Iv)),e.onGetComponent("row",(({rowType:e})=>{if("rule"===e)return Bv})),e.onGetComponent("cell",(({cellType:e})=>{if("rule"===e)return Lv}))}};Nv.$inject=["components"];var qv={__depends__:[jv],__init__:["decisionRules"],decisionRules:["type",Nv]};const Vv=[{label:"Unique",value:{hitPolicy:"UNIQUE",aggregation:void 0},explanation:"No overlap is possible and all rules are disjoint. Only a single rule can be matched"},{label:"First",value:{hitPolicy:"FIRST",aggregation:void 0},explanation:"Rules may overlap. The first matching rule will be chosen"},{label:"Priority",value:{hitPolicy:"PRIORITY",aggregation:void 0},explanation:"Rules may overlap. The one with the highest priority will be chosen"},{label:"Any",value:{hitPolicy:"ANY",aggregation:void 0},explanation:"Rules may overlap. Their output have to match"},{label:"Collect",value:{hitPolicy:"COLLECT",aggregation:void 0},explanation:"Collects the values of all matching rules"},{label:"Collect (Sum)",value:{hitPolicy:"COLLECT",aggregation:"SUM"},explanation:"Collects the values of all matching rules and sums up to a single value"},{label:"Collect (Min)",value:{hitPolicy:"COLLECT",aggregation:"MIN"},explanation:"Collects the values of all matching rules and uses the lowest value"},{label:"Collect (Max)",value:{hitPolicy:"COLLECT",aggregation:"MAX"},explanation:"Collects the values of all matching rules and uses the highest value"},{label:"Collect (Count)",value:{hitPolicy:"COLLECT",aggregation:"COUNT"},explanation:"Collects the values of all matching rules and counts the number of them"},{label:"Rule order",value:{hitPolicy:"RULE ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in rule order"},{label:"Output order",value:{hitPolicy:"OUTPUT ORDER",aggregation:void 0},explanation:"Collects the values of all matching rules in decreasing output priority order"}];class Fv extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),av(this)}getRoot(){return this.sheet.getRoot()}render(){const e=this.getRoot().businessObject,{aggregation:t,hitPolicy:n}=e,i=h(Vv,(e=>function(e,t){return e.hitPolicy===t.hitPolicy&&e.aggregation===t.aggregation}(e.value,{aggregation:t,hitPolicy:n})));return vr(1,"div","hit-policy header",[vr(1,"label","dms-label",this._translate("Hit policy:"),0),vr(1,"span","hit-policy-value",this._translate(i.label),0)],4,{title:this._translate(i.explanation)})}}function zv(e){e.onGetComponent("hit-policy",(()=>Fv))}Fv.$inject=["sheet"],zv.$inject=["components"];var Qv={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",zv]};let Hv=class extends Ds{constructor(e,t){super(e,t);const{injector:n}=t;this._translate=n.get("translate"),this._eventBus=n.get("eventBus")}onClick=()=>{this._eventBus.fire("showDrd")};render(){return vr(1,"div","view-drd",vr(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(e=>this.node=e))}},Wv=class{constructor(e,t,n,i){this._injector=n,this._sheet=i,e.onGetComponent("table.before",(()=>{if(this.canViewDrd())return Hv})),t.on("showDrd",(()=>{const e=n.get("_parent",!1),t=Uv(i.getRoot());if(!t)return;const o=e.getView(t);e.open(o)}))}canViewDrd(){const e=this._injector.get("_parent",!1);if(!e)return!1;const t=Uv(this._sheet.getRoot());return!!e.getView(t)}};function Uv(e){const{businessObject:t}=e;if(!t)return;return t.$parent.$parent}Wv.$inject=["components","eventBus","injector","sheet"];var Xv={__init__:["viewDrd"],viewDrd:["type",Wv]};let Kv=class{constructor(e){e.onGetComponent("table.before",(()=>Bs))}};Kv.$inject=["components"];var Gv={__init__:["poweredBy"],poweredBy:["type",Kv]};let Yv=class e extends nv{constructor(t={}){const n=e._createContainer();super(M(t,{renderer:{container:n}})),this._container=n}open(e){var t=this;return new Promise(((n,i)=>{var o;try{return t._decision&&t.clear(),t._decision=e,function(e,t,n){const i=e.get("tableImporter"),o=e.get("eventBus"),r=e.get("sheet");e.get("modeling",!1);let s,a=[];o.fire("import.render.start",{decision:t});try{!function(e){new ov({create:(e,t,n,o)=>i.create(e,t,n,o),table:e=>i.add(e),element:(e,t,n)=>i.add(e,t,n),error(e,t){a.push({message:e,context:t})}}).handleDecision(e)}(t)}catch(e){s=e}o.fire("import.render.complete",{error:s,warnings:a}),o.fire("elements.changed",{elements:[r.getRoot()]}),n(s,a)}(t,e,(function(e,t){e?(e.warnings=t||[],i(e)):n({warnings:t||[]})}))}catch(e){o=e}o?(o.warnings=o.warnings||[],i(o)):n({warnings:[]})}))}_init(e){let{modules:t,additionalModules:n,...i}=e,o=t||this.getModules();return{modules:[Gv,...o,...n||[],...[{decisionTable:["value",this]}]],config:i}}on(e,t,n,i){return this.get("eventBus").on(e,t,n,i)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}attachTo(e){if(!e)throw new Error("parentNode required");this.detach();const t=this._container;e.appendChild(t),this._emit("attach",{})}detach(){const e=this._container;e.parentNode&&(this._emit("detach",{}),en(e))}destroy(){super.destroy(),this.detach()}getModules(){return e._getModules()}static _getModules(){return[vv,bv,ha,kv,Tv,Pv,qv,Qv,Xv]}static _createContainer(){return Gt('<div class="dmn-decision-table-container"></div>')}};class Zv extends Ds{constructor(e,t){super(e,t),av(this),this.addRule=this.addRule.bind(this)}componentWillMount(){this._eventBus=this.context.injector.get("eventBus")}handleClick=e=>{e.stopPropagation(),this.addRule(e.target.dataset.colIndex)};addRule(e){this._eventBus.fire("addRule",{colIndex:e})}render(){const{cols:e}=this.props,t=[vr(1,"td","add-rule-add",vr(1,"button","dmn-icon-plus action-icon",null,1,{title:this.translate("Add rule")}),2)],{businessObject:n}=this.sheet.getRoot();n.input&&n.input.length||t.push(vr(1,"td","input-cell",xr("-"),2));for(let n=0;n<e.length+1;n++){let i="add-rule";const o=e[n]&&e[n].businessObject;let r="";o?(o.$instanceOf("dmn:InputClause")&&(i+=" input-cell",r="-"),o.$instanceOf("dmn:OutputClause")&&(i+=" output-cell")):i+=" annotation",t.push(vr(1,"td",i,r,0,{"data-col-index":n}))}return vr(1,"tfoot","actionable add-rule",vr(1,"tr",null,t,0),2,{onClick:this.handleClick})}}Zv.$inject=["sheet","translate"];class Jv{constructor(e,t,n,i){e.onGetComponent("table.foot",(()=>Zv)),n.on("addRule",((e,n)=>{const o=t.trigger("addRule"),r=n.colIndex;o.cells[r]?i.select(o.cells[r]):i.select(o.cells[0])}))}}Jv.$inject=["components","editorActions","eventBus","selection"];class ey{constructor(e,t,n){this._elementRegistry=e,this._eventBus=t,this._renderer=n,this._selection=void 0,t.on("diagram.clear",(()=>{this._selection=void 0}))}select(e){c(e)&&(e=this._elementRegistry.get(e));const t=this._selection;t!==e&&(this._selection=e,this._eventBus.fire("selection.changed",{oldSelection:t,selection:e}))}deselect(){const e=this._selection;this._selection=void 0,this._eventBus.fire("selection.changed",{oldSelection:e,selection:this._selection})}get(){return this._selection}hasSelection(){return!!this._selection}}ey.$inject=["elementRegistry","eventBus","renderer"];class ty{constructor(e,t,n,i){this._elementRegistry=e,this._renderer=n,this._selection=i,t.on(["cell.click","cell.contextmenu"],(({id:t})=>{const n=e.get(t);n&&i.select(n)})),t.on("row.remove",(({row:e})=>{const t=i.get();t&&e===t.row&&i.deselect()})),t.on("col.remove",(({col:e})=>{const t=i.get();t&&e===t.col&&i.deselect()}))}}ty.$inject=["elementRegistry","eventBus","renderer","selection"];var ny={__init__:["selection","selectionBehavior"],selection:["type",ey],selectionBehavior:["type",ty]};const iy=["click","dblclick","contextmenu","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","mousemove","focusin","focusout","drag","dragstart","dragend","dragover","dragenter","dragleave","drop"];class oy{constructor(e,t){var n,i,o;o=e=>{const{target:t,type:n}=e,i=Bt(t,"[data-element-id]",!0);if(!i)return;const o=i.getAttribute("data-element-id");if(o){const t=this._eventBus.createEvent({id:o,event:e,node:i,target:i});this._eventBus.fire(`cell.${n}`,t),t.defaultPrevented&&e.preventDefault(),t.cancelBubble&&e.stopPropagation()}},(i="_handleEvent")in(n=this)?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,this._eventBus=t,this._container=e.container,t.on("table.init",(()=>{this._addEventListeners(iy)})),t.on("table.destroy",(()=>{this._removeEventListeners(iy)}))}_addEventListeners(e){const t=this._container;e.forEach((e=>{t.addEventListener(e,this._handleEvent)}))}_removeEventListeners(e){const t=this._container;e.forEach((e=>{t.removeEventListener(e,this._handleEvent)}))}}oy.$inject=["config.renderer","eventBus"];var ry={__init__:["interactionEvents"],interactionEvents:["type",oy]},sy="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ay(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ly,cy={exports:{}},uy=cy.exports;
192 /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */var hy=(ly||(ly=1,function(e,t){var n;n=void 0!==sy?sy:uy,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,o=-1,r="",s=n.charCodeAt(0);++o<i;)0!=(t=n.charCodeAt(o))?r+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==s?"\\"+t.toString(16)+" ":0==o&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):r+="�";return r};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}(cy)),cy.exports),dy=ay(hy),py=function(e,t){return e^t};var fy=/\b(Array|Date|Object|Math|JSON)\b/g,gy=function(e,t){var n=function(e){for(var t=[],n=0;n<e.length;n++)~t.indexOf(e[n])||t.push(e[n]);return t}(function(e){return e.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(fy,"").match(/[a-zA-Z_]\w*/g)||[]}(e));return t&&"string"==typeof t&&(t=function(e){return function(t){return e+t}}(t)),t?function(e,t,n){var i=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return e.replace(i,(function(e){return"("==e[e.length-1]||~t.indexOf(e)?n(e):e}))}(e,n,t):n};var my=vy;function vy(e,t){if(!(this instanceof vy))return new vy(e,t);if(this.node=this.start=this.peeked=e,this.root=t,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],e&&this.higher(e))throw new Error("root must be a parent or ancestor to node")}function yy(e,t){var n="nextSibling"==e;return function(i,o,r){i=this.compile(i),o=o&&o>0?o:1;for(var s=this.node,a=this.closingTag,l=this._revisit;s;){if(py(n,a)&&s[t])s=s[t],a=!n;else if(1==s.nodeType&&!s[t]&&py(n,a)){if(a=n,!l)continue}else if(s[e])s=s[e],a=!n;else if(s=s.parentNode,a=n,!l)continue;if(!s||this.higher(s,this.root))break;if(i(s)&&this.selects(s,r)&&this.rejects(s,r)){if(--o)continue;return r||(this.node=s),this.closingTag=a,s}}return null}}vy.prototype.reset=function(e){return this.node=e||this.start,this},vy.prototype.revisit=function(e){return this._revisit=null==e||e,this},vy.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},vy.prototype.atOpening=function(){return!this.closingTag},vy.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},vy.prototype.atClosing=function(){return this.closingTag},vy.prototype.next=yy("nextSibling","firstChild"),vy.prototype.previous=vy.prototype.prev=yy("previousSibling","lastChild"),vy.prototype.select=function(e){return e=this.compile(e),this._selects.push(e),this},vy.prototype.selects=function(e,t){var n=this._selects,i=n.length;if(!i)return!0;for(var o=0;o<i;o++)if(n[o].call(this,e,t))return!0;return!1},vy.prototype.reject=function(e){return e=this.compile(e),this._rejects.push(e),this},vy.prototype.rejects=function(e,t){var n=this._rejects,i=n.length;if(!i)return!0;for(var o=0;o<i;o++)if(n[o].call(this,e,t))return!1;return!0},vy.prototype.higher=function(e){var t=this.root;if(!t)return!1;for(e=e.parentNode;e&&e!=t;)e=e.parentNode;return e!=t},vy.prototype.compile=function(e){switch(typeof e){case"number":return function(t){return e==t.nodeType};case"string":return new Function("node","return "+gy(e,"node."));case"function":return e;default:return function(){return!0}}},vy.prototype.peak=vy.prototype.peek=function(e,t){return 1==arguments.length&&(t=e,e=!0),(t=null==t?1:t)?t>0?this.next(e,t,!0):this.prev(e,Math.abs(t),!0):this.node},vy.prototype.use=function(e){return e(this),this};var xy=window.getSelection();function by(e){xy.removeAllRanges(),xy.addRange(e)}function _y(e,t){var n=function(e,t){var n,i=t.start,o=t.end,r=document.createRange(),s=my(e.firstChild,e),a=s.node,l=!1,c=0;for(;a;){if(c===i&&(l?r.setStartAfter(a):r.setStartBefore(a)),c===o)return l?r.setEndAfter(a):r.setEndBefore(a),r;if(l||(Oy(a)||a.previousSibling&&(ky(a)||Ey(a)))&&c++,Cy(a)){if(n=a.textContent.length,c<=i&&c+n>i&&r.setStart(a,i-c),c+n>o)return r.setEnd(a,o-c),r;c+=n}a=s.next(),l=s.closingTag}c<=i&&(e.lastChild?r.setStartAfter(e.lastChild):r.setStart(e,0));e.lastChild?r.setEndAfter(e.lastChild):r.setEnd(e,0);return r}(e,t);by(n)}function wy(e){if(!function(e){if(!xy.rangeCount)return null;var t=xy.focusNode;return Cy(t)&&(t=t.parentNode),e==t||e.contains(t)}(e))return null;var t,n,i=xy.getRangeAt(0),o=i.startContainer,r=i.endContainer,s=i.startOffset,a=i.endOffset,l=my(e.firstChild,e),c=l.node,u=!1,h=0;function d(e,t){return 1===arguments.length&&(t=e),e.parentNode===r&&t==r.childNodes[a]}function p(e,t){return 1===arguments.length&&(t=e),e.parentNode===o&&t==o.childNodes[s]}for(;c&&(p(c)&&(n=h),!d(c));){if(u||(Oy(c)||t&&t.nextSibling==c&&(ky(c)||Ey(c)))&&h++,Cy(c)){if(o===c&&(n=h+s),r===c){h+=a;break}h+=c.textContent.length}if((Cy(c)||u)&&(p(c,c.nextSibling)&&(n=h),d(c,c.nextSibling)))break;t=c,c=l.next(),u=l.closingTag}return{start:void 0===n?h:n,end:h}}function Cy(e){return 3===e.nodeType}function Oy(e){return 1===e.nodeType&&"BR"===e.nodeName}function ky(e){return 1===e.nodeType&&"DIV"===e.nodeName}function Ey(e){return 1===e.nodeType&&"P"===e.nodeName}const Sy="[contenteditable]",Ry="[data-element-id]";function Ty(e){return e.getAttribute("data-element-id")}function My(e,t){return Zt(`[data-element-id="${dy(e)}"]`,t)}function Ay(e){return Bt(e,Ry,!0)}function Py(e){const t=Sy;return Yt(e,t)?e:Zt(t,e)}const Dy={above:!0,below:!0,right:!0,left:!0};function $y(e,t,n,i,o){const{container:r}=e;let s=null;function a(e,n){t.fire("selection."+e+".changed",n),t.fire("cellSelection.changed",{elementId:e,selection:n})}function l(e,t=!0){s!==e&&a(s,{selected:!1,focussed:!1}),s=e,e&&a(e,{selected:!0,focussed:t}),e?i.select(e):i.deselect()}t.on("cell.click",500,(function(e){const t=e.target;if(function(e){return Bt(e,".no-deselect",!0)}(t))return;const n=Ay(t);l(n&&Ty(n),!e.defaultPrevented)})),t.on("cell.focusin",500,(function(e){const t=Ty(e.target),n=!e.defaultPrevented;return e.stopPropagation(),l(t,n)})),t.on("cell.focusout",500,(function(e){a(Ty(e.target),{focussed:!1})})),t.on("cellSelection.changed",(function(e){const{elementId:t,selection:n}=e,i=My(t,r);n.focussed&&i&&function(e){const t=Py(e);if(!t)return;if(!document.body.contains(t))return;if(document.activeElement===t)return;t.focus();const n=wy(t);n&&0!==n.end||window.getSelection().setPosition(t.firstChild,t.firstChild.length)}(i)})),t.on("selection.changed",(function(e){const{selection:t,oldSelection:n}=e;var i=t&&t.id,o=n&&n.id;i&&i!==s?l(t.id):o&&o===s&&l()})),this.isCellSelected=function(){return!!s},this.getCellSelection=function(){return s},this.selectCell=function(e){if(!s)return;if(!(e in Dy))throw new Error("direction must be any of { above, below, left, right }");const t=function(e){const t=e.getAttribute("data-coords");if(!t)return null;const[n,i]=t.split(":");return{row:n,col:i}}(My(s,r));if(!t)return!1;const n=function(e,t){const{row:n,col:i}=e;if("above"===t||"below"===t){const o=parseInt(n,10);if(isNaN(o))return e;return{col:i,row:"above"===t?o-1:o+1}}if("left"===t||"right"===t){const o=parseInt(i,10);if(isNaN(o))return e;return{row:n,col:"left"===t?o-1:o+1}}throw new Error("invalid direction <"+t+">")}(t,e),i=function(e,t){const n=`${e.row}:${e.col}`;return Zt(`[data-coords="${dy(n)}"]`,t)}(n,r);if(!i)return!1;const o=Ty(i);return o&&l(o,{focussed:!0,selected:!0}),!0},t.on("contextMenu.close",(function(){if(s)return l(s)}))}$y.$inject=["config.renderer","eventBus","sheet","selection","elementRegistry"];var jy={__depends__:[ry,ny],__init__:["cellSelection"],cellSelection:["type",$y]};function Iy(){}Iy.prototype.get=function(){return this._data},Iy.prototype.set=function(e){this._data=e},Iy.prototype.clear=function(){var e=this._data;return delete this._data,e},Iy.prototype.isEmpty=function(){return!this._data};var By={clipboard:["type",Iy]};const Ly=2e3;class Ny extends zp{constructor(e,t){super(e),this._sheet=t}init(){this.addRule("col.move",Ly,(({col:e,index:t})=>{const{businessObject:n}=this._sheet.getRoot(),{input:i}=n;return dn(e)?t<i.length:t>=i.length})),this.addRule("col.remove",Ly,(({col:e})=>{const{cols:t}=this._sheet.getRoot();return!pn(e)||t.filter((e=>pn(e))).length>1})),this.addRule("paste",Ly,(({data:e,target:t})=>{if(!e||!t)return!1;const{root:n}=e;return t instanceof Nm?this.canPasteRows(n):t instanceof qm&&this.canPasteCols(n,t)}))}canPasteRows(e){const{cols:t}=this._sheet.getRoot();return g(e,(e=>"row"===e.type&&(e.cells.length===t.length&&g(e.cells,((e,n)=>dn(t[n])?"dmn:UnaryTests"===e.businessObject.$type:"dmn:LiteralExpression"===e.businessObject.$type)))))}canPasteCols(e,t){const{rows:n}=this._sheet.getRoot();return g(e,(e=>"col"===e.type&&(e.cells.length===n.length&&(dn(t)?"dmn:InputClause"===e.businessObject.$type:"dmn:OutputClause"===e.businessObject.$type))))}}Ny.$inject=["eventBus","sheet"];var qy={__depends__:[{__depends__:[gc]}],__init__:["decisionTableModelingRules"],decisionTableModelingRules:["type",Ny]};class Vy{constructor(e,t,n){this._clipboard=e,this._modeling=t,this._sheet=n}execute(e){let{data:t}=e;return e.oldData=this._clipboard.get(),this._clipboard.set(t),this._sheet.getRoot()}postExecute(e){let{elements:t}=e;t.forEach((e=>{e instanceof Nm?this._modeling.removeRow(e):e instanceof qm&&this._modeling.removeCol(e)}))}revert(e){const{oldData:t}=e;return this._clipboard.set(t),this._sheet.getRoot()}}Vy.$inject=["clipboard","modeling","sheet"];const Fy=[function(e,t,n,i){var o=n,r={...t,type:Wy(e)};if(e instanceof Nm||e instanceof qm){let t=i(e.cells,o);r.cells=t.root,o=t.descriptorCache}return{root:r,descriptorCache:o}},function(e,t,n){var i=e.businessObject;if(!i)return{root:t,descriptorCache:n};var o=Uy(i,n);return{root:{...t,businessObject:o.root},descriptorCache:o.descriptorCache}}],zy=[function(e,t,n){var i=e.root.businessObject;if(!i)return{root:t,reviveCache:n};var o=Gy({root:i,descriptorCache:e.descriptorCache},n);return{root:{...t,businessObject:o.root},reviveCache:o.reviveCache}},function(e,t,n,i){var o=e.root,r=e.descriptorCache,s={...t};t.businessObject&&t.businessObject.id&&(s.id=t.businessObject.id);if("row"===o.type||"col"===o.type){let e=i({root:o.cells,descriptorCache:r},n);s.cells=e.root,n=e.reviveCache}var a=new(function(e){switch(e.type){case"row":return Nm;case"cell":return Vm;case"col":return qm;default:throw new Error("unknown element type: #"+e.type)}}(o))(s);a instanceof Nm?a.cells.forEach((e=>{e.row=a})):a instanceof qm&&a.cells.forEach((e=>{e.col=a}));return{root:a,reviveCache:n}}];function Qy(e,t,n){return n=n||Fy,t=t||{},r(e)?function(e,t,n){return f(e,((e,t)=>{var i=e.descriptorCache,o=e.root;let{root:r,descriptorCache:s}=Hy(t,i,n);return{root:[...o,r],descriptorCache:{...i,...s}}}),{root:[],descriptorCache:t})}(e,t,n):Hy(e,t,n)}function Hy(e,t,n){var i=e.id,o={id:i},r=t.elements||{},s=r[i];if(s)return{root:s,descriptorCache:t};let a=function(e,t,n,i){function o(e,t){return Qy(e,t,n)}return f(n,(function(t,n){return n(e,t.root,t.descriptorCache,o)}),{root:t,descriptorCache:i})}(e,o,n,{...t,elements:r});return{root:a.root,descriptorCache:{...a.descriptorCache,elements:{...a.descriptorCache.elements,[i]:a.root}}}}function Wy(e){if(e instanceof Nm)return"row";if(e instanceof qm)return"col";if(e instanceof Vm)return"cell";throw new Error("cannot deduce element type: #"+e.id)}function Uy(e,t){var n,i,o=e.id;if(o&&(i=(n=t.boCache||{})[o]))return{root:i,descriptorCache:t};var s={$type:e.$type};return o&&(s.id=o,n={...n,[o]:s},t={...t,boCache:n}),e.$descriptor.properties.forEach((function(n){var i=e[n.name];if(i){if(r(i)&&(i=i.map((e=>{var n=Uy(e,t);return t=n.descriptorCache,n.root}))),i.$type){let e=Uy(i,t);t=e.descriptorCache,i=e.root}s[n.name]=i}})),{root:s,descriptorCache:t}}function Xy(e,t,n){return n=n||zy,t=t||{},r(e.root)?function(e,t,n){let i=e.root,o=e.descriptorCache;return f(i,((e,t)=>{var i=e.reviveCache,r=e.root;let{root:s,reviveCache:a}=Ky({root:t,descriptorCache:o},i,n);return{root:[...r,s],reviveCache:a}}),{root:[],reviveCache:t})}(e,t,n):Ky(e,t,n)}function Ky(e,t,n){var i=e.root.id,o=t.elements||{},r=o[i];if(r)return{root:r,reviveCache:t};let s=function(e,t,n,i){function o(e,t){return Xy(e,t,n)}return f(n,(function(t,n){return n(e,t.root,t.reviveCache,o)}),{root:t,reviveCache:i})}(e,{id:i},n,{...t,elements:o});return{root:s.root,reviveCache:{...s.reviveCache,elements:{...s.reviveCache.elements,[i]:s.root}}}}function Gy(e,t){var n=e.root,i=n.id;let o,s;if(i&&(o=t.boCache||{},s=o[i],s))return{root:s,reviveCache:t};var a={};y(n).forEach((e=>{let i,s;n[e].$type?(s=Gy({root:n[e]},t),i=s.root,t=s.reviveCache,o=t.boCache||{}):i=r(n[e])?n[e].map((e=>(s=Gy({root:e},t),t=s.reviveCache,o=t.boCache||{},s.root))):n[e],a[e]=i}));const l=a.$type;delete a.$type,t._keepIds&&!t._model.ids.assigned(a.id)||delete a.id;var c=t._dmnFactory.create(l,a);return p(a,(e=>{e.$type&&(e.$parent=c),r(e)&&e.forEach((e=>e.$parent=c))})),i&&(o={...o,[i]:c},t={...t,boCache:o}),{root:c,reviveCache:t}}class Yy{constructor(e,t,n,i,o,r,s,a){this._clipboard=e,this._dmnFactory=t,this._elementFactory=n,this._elementRegistry=i,this._eventBus=o,this._model=r,this._modeling=s,this._sheet=a}postExecute(e){let{element:t,after:n}=e;const i=this._clipboard.get();if(!i)throw new Error("missing clipboard data");const o=this._sheet.getRoot(),r=Xy(i.elements,{_dmnFactory:this._dmnFactory,_keepIds:i.keepIds,_model:this._model}).root;if(t instanceof Nm){let e=o.rows.indexOf(t);if(-1===e)return;r.forEach((t=>{n&&e++,this._modeling.addRow(t,e)}))}else if(t instanceof qm){let e=o.cols.indexOf(t);if(-1===e)return;r.forEach((t=>{n&&e++,this._modeling.addCol(t,e)}))}return e.oldElements=this._clipboard.get(),this._sheet.getRoot()}revert(e){}}Yy.$inject=["clipboard","dmnFactory","elementFactory","elementRegistry","eventBus","moddle","modeling","sheet"];class Zy{constructor(e,t,n,i,o,r){this._clipboard=e,this._commandStack=t,this._eventBus=n,this._modeling=i,this._sheet=o,this._rules=r,t.registerHandler("cut",Vy),t.registerHandler("paste",Yy)}copy(e){r(e)||(e=[e]);const t={elements:Qy(e)};this._eventBus.fire("copyCutPaste.copy",{data:t}),this._clipboard.set(t)}cut(e){r(e)||(e=[e]);const t={elements:Qy(e),keepIds:!0},n={elements:e,data:t};this._eventBus.fire("copyCutPaste.cut",{data:t}),this._commandStack.execute("cut",n)}pasteBefore(e){return this._paste(e,{before:!0})}pasteAfter(e){return this._paste(e,{after:!0})}_paste(e,t){const n=this._clipboard.get();if(!n)return;return!!this._rules.allowed("paste",{data:n.elements,target:e})&&(this._commandStack.execute("paste",{element:e,...t}),this._clipboard.clear(),!0)}pasteAt(e){}}Zy.$inject=["clipboard","commandStack","eventBus","modeling","sheet","rules"];var Jy={__depends__:[By,qy],__init__:["copyCutPaste"],copyCutPaste:["type",Zy]};class ex{constructor(e,t,n,i,o,r){const s={addRule:()=>n.addRow({type:"dmn:DecisionRule"}),addRuleAbove(e){let t=e&&e.rule;if(!t&&!i.hasSelection())return;t=t||i.get().row;const o=r.getRoot().rows.indexOf(t);return-1!==o?n.addRow({type:"dmn:DecisionRule"},o):void 0},addRuleBelow(e){let t=e&&e.rule;if(!t&&!i.hasSelection())return;t=t||i.get().row;const o=r.getRoot().rows.indexOf(t);return-1!==o?n.addRow({type:"dmn:DecisionRule"},o+1):void 0},removeRule(e){let t=e&&e.rule;(t||i.hasSelection())&&(t=t||i.get().row,n.removeRow(t))},addInput(){const e=r.getRoot().businessObject,{input:t}=e;return n.addCol({type:"dmn:InputClause"},t?t.length:0)},addInputLeft(e){let t=e&&e.input;if(!t&&!i.hasSelection())return;t=t||i.get().col;const o=r.getRoot().cols.indexOf(t);return-1!==o?n.addCol({type:"dmn:InputClause"},o):void 0},addInputRight(e){let t=e&&e.input;if(!t&&!i.hasSelection())return;t=t||i.get().col;const o=r.getRoot().cols.indexOf(t);return-1!==o?n.addCol({type:"dmn:InputClause"},o+1):void 0},removeInput(e){let t=e&&e.input;(t||i.hasSelection())&&(t=t||i.get().col,n.removeCol(t))},addOutput(){const e=r.getRoot().businessObject,t=e.get("input"),i=e.get("output");return n.addCol({type:"dmn:OutputClause"},t.length+i.length)},addOutputLeft(e){let t=e&&e.output;if(!t&&!i.hasSelection())return;t=t||i.get().col;const o=r.getRoot().cols.indexOf(t);return-1!==o?n.addCol({type:"dmn:OutputClause"},o):void 0},addOutputRight(e){let t=e&&e.output;if(!t&&!i.hasSelection())return;t=t||i.get().col;const o=r.getRoot().cols.indexOf(t);return-1!==o?n.addCol({type:"dmn:OutputClause"},o+1):void 0},removeOutput(e){let t=e&&e.output;(t||i.hasSelection())&&(t=t||i.get().col,n.removeCol(t))},addClause(){if(!i.hasSelection())return;const e=i.get().col;return hn(e,"dmn:InputClause")?s.addInput({input:e}):hn(e,"dmn:OutputClause")?s.addOutput({output:e}):void 0},addClauseLeft(){if(!i.hasSelection())return;const e=i.get().col;return hn(e,"dmn:InputClause")?s.addInputLeft({input:e}):hn(e,"dmn:OutputClause")?s.addOutputLeft({output:e}):void 0},addClauseRight(){if(!i.hasSelection())return;const e=i.get().col;return hn(e,"dmn:InputClause")?s.addInputRight({input:e}):hn(e,"dmn:OutputClause")?s.addOutputRight({output:e}):void 0},removeClause(){if(!i.hasSelection())return;const e=i.get().col;return hn(e,"dmn:InputClause")?s.removeInput({input:e}):hn(e,"dmn:OutputClause")?s.removeOutput({output:e}):void 0},selectCellAbove:()=>o.selectCell("above"),selectCellBelow:()=>o.selectCell("below"),copy({element:t}){e.copy(t)},cut({element:t}){e.cut(t)},pasteBefore:({element:t})=>e.pasteBefore(t),pasteAfter:({element:t})=>e.pasteAfter(t)};t.register(s)}}ex.$inject=["copyCutPaste","editorActions","modeling","selection","cellSelection","sheet"];const tx="is not a registered action";let nx=class{constructor(e,t,n,i){this._actions={undo(){e.undo()},redo(){e.redo()},select({cell:e}){i.select(e)},deselect(){i.deselect()},addRow({attrs:e,index:t}){n.addRow(e,t)},removeRow({row:e}){n.removeRow(e)},moveRow({row:e,index:t}){n.moveRow(e,t)},addCol({attrs:e,index:t}){n.addCol(e,t)},removeCol({col:e}){n.removeCol(e)},moveCol({col:e,index:t}){n.moveCol(e,t)}}}trigger(e,t){if(!this._actions[e])throw ix(e,tx);return this._actions[e](t)}register(e,t){if("string"==typeof e)return this._registerAction(e,t);p(e,((e,t)=>{this._registerAction(t,e)}))}_registerAction(e,t){if(this.isRegistered(e))throw ix(e,"is already registered");this._actions[e]=t}unregister(e){if(!this.isRegistered(e))throw ix(e,tx);this._actions[e]=void 0}isRegistered(e){return!!this._actions[e]}};function ix(e,t){return new Error(e+" "+t)}nx.$inject=["commandStack","eventBus","modeling","selection"];var ox,rx,sx={__depends__:[ny],__init__:["editorActions"],editorActions:["type",nx]},ax={__depends__:[jy,Jy,sx,ny],__init__:["decisionTableEditorActions"],decisionTableEditorActions:["type",ex]},lx={__depends__:[ax],__init__:["addRule"],addRule:["type",Jv]};var cx,ux=function(){if(rx)return ox;rx=1;var e=/["'&<>]/;return ox=function(t){var n,i=""+t,o=e.exec(i);if(!o)return i;var r="",s=0,a=0;for(s=o.index;s<i.length;s++){switch(i.charCodeAt(s)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#39;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}a!==s&&(r+=i.substring(a,s)),a=s+1,r+=n}return a!==s?r+i.substring(a,s):r},ox}(),hx=ay(ux),dx={exports:{}};var px=function(){if(cx)return dx.exports;function e(e,t){return{start:e,end:void 0===t?e:t}}return cx=1,dx.exports=function(t,n,i){var o=t.start,r=o,s=(i.length,n.length);i.length,n.length;var a=n.substring(o);return i.lastIndexOf(a)===i.length-a.length&&(n=n.substring(0,n.length-a.length),i=i.substring(0,i.length-a.length)),s=function(e,t){var n,i,o,r=0,s=0;t.length>e.length?(i=t,o=e):(i=e,o=t);for(;r<i.length;)i.charAt(r)!==o.charAt(s)?(n||(n={l_start:r,s_start:s}),r++):(n&&!n.complete&&(n.l_end=r,n.s_end=s,n.complete=!0),s++,r++);n&&!n.complete&&(n.complete=!0,n.s_end=o.length,n.l_end=i.length);if(!n)return;return t.length>e.length?{newStart:n.l_start,newEnd:n.l_end,type:"add"}:{newStart:n.s_start,newEnd:n.s_end,type:t.length<e.length?"remove":"replace"}}(n,i),s&&(r="remove"===s.type?s.newStart:s.newEnd),e(r)},dx.exports.range=e,dx.exports}(),fx=ay(px);class gx extends Ds{constructor(e,t){var n;super(e,t),this.state={},((n=window.navigator.userAgent).indexOf("MSIE ")>0||n.indexOf("Trident/")>0)&&(this.onInputIEPolyfill=e=>{var t=this.node.innerHTML;setTimeout((()=>{var n=this.node.innerHTML;t!==n&&this.onInput(e)}),0)})}componentWillUpdate(e,t){var n=this.node,i=t.focussed&&wy(n);this.selected=i&&{range:i,text:mx(n)}}componentDidUpdate(){var e=this.selected;if(!e)return;const t=e.range,n=e.text,i=this.node,o=mx(i);_y(i,o!==n?fx(t,n,o):t)}onFocus=e=>{var t=this.props.onFocus;this.setState({focussed:!0}),"function"==typeof t&&t(e)};onBlur=e=>{const{onBlur:t,onChange:n,value:i}=this.props;if(this.setState({focussed:!1}),"function"==typeof n&&this.node){const e=mx(this.node);e!==i&&n(e)}"function"==typeof t&&t(e)};onkeydown=e=>{if(13===e.which){if(e.preventDefault(),this.props.ctrlForNewline&&!function(e){return e.metaKey||e.ctrlKey}(e))return;if(this.props.singleLine)return;e.stopPropagation(),function(){var e=xy,t=e.getRangeAt(0);if(!t)return;var n=t.cloneRange(),i=document.createElement("br");n.deleteContents(),n.insertNode(i),n.setStartAfter(i),n.setEndAfter(i),by(n)}(),this.onInput(e)}};onInput=e=>{var t=this.props.onInput;"function"==typeof t&&t(mx(this.node))};onkeypress=e=>{this.onInputIEPolyfill&&this.onInputIEPolyfill(e)};onPaste=e=>{if(this.onInputIEPolyfill&&this.onInputIEPolyfill(e),this.props.singleLine){const t=(e.clipboardData||window.clipboardData).getData("text");document.execCommand("insertText",!1,t.replace(/\n/g," ")),e.preventDefault()}};getClassName(){const{className:e,placeholder:t,value:n}=this.props;return[e||"","content-editable",!n&&t?"placeholder":""].join(" ")}render(e){var{label:t,value:n,placeholder:i}=e;return n=hx(n).replace(/\r?\n/g,"<br/>")+"<br/>",vr(1,"div",this.getClassName(),null,1,{"aria-label":t,role:"textbox","aria-multiline":!this.props.singleLine,tabIndex:"0",contentEditable:"true",spellCheck:"false","data-placeholder":i||"",onInput:this.onInput,onkeypress:this.onkeypress,onPaste:this.onPaste,onFocus:this.onFocus,onBlur:this.onBlur,onkeydown:this.onkeydown,dangerouslySetInnerHTML:{__html:n}},null,(e=>this.node=e))}}function mx(e){return e.innerText.replace(/\n$/,"")}class vx extends Ds{constructor(e,t){super(e,t),this.state={changing:!1,focussed:!1};const{injector:n}=t,i=n.get("debounceInput");this.inputChanged=i((e=>{const{onChange:t}=this.props;"function"==typeof t&&t(e);const n=this.state.changing;this.setState({changing:n!==e&&n})})),this.onInput=e=>{var t=(this.props.validate||function(){})(e);this.setState({changing:e,invalid:t}),t||this.inputChanged(e)}}onFocus=e=>{this.setState({focussed:!0});var{onFocus:t}=this.props;"function"==typeof t&&t(e)};onBlur=e=>{this.setState({focussed:!1});const{invalid:t}=this.state;t&&this.setState({changing:!1,invalid:!1});const{onBlur:n}=this.props;"function"==typeof n&&n(e)};getClassName(){var{className:e,value:t}=this.props,{changing:n,focussed:i,invalid:o}=this.state;return e+=" editable",i&&(e+=" focussed"),o&&(e+=" invalid"),t||n||(e+=" empty"),e}getDisplayValue(){var{value:e,placeholder:t}=this.props,{focussed:n,changing:i}=this.state;return"string"==typeof i&&(e=i),e||(e=n?"":t||""),e}getEditor(e={}){return yr(2,gx,{className:e.className,ctrlForNewline:this.props.ctrlForNewline,label:this.props.label,onFocus:this.onFocus,onBlur:this.onBlur,onInput:this.onInput,value:this.getDisplayValue()})}}class yx extends Ds{constructor(e,t){super(e,t),av(this)}componentWillMount(){const{row:e}=this.props;this.changeSupport.onElementsChanged(e.id,this.onElementsChanged)}componentWillUnmount(){const{row:e}=this.props;this.changeSupport.offElementsChanged(e.id,this.onElementsChanged)}onElementsChanged=()=>{this.forceUpdate()};setAnnotationValue=e=>{const{row:t}=this.props;this.modeling.editAnnotation(t.businessObject,e)};render(){const{row:e,rowIndex:t}=this.props,{description:n,id:i}=e.businessObject;return yr(2,dv,{className:"annotation",onChange:this.setAnnotationValue,coords:`${t}:annotation`,value:n,elementId:i,"data-row-id":e.id,children:yr(2,xx,{label:this.translate("Annotation"),ctrlForNewline:!0,className:"annotation-editor",onChange:this.setAnnotationValue,value:n})})}}yx.$inject=["changeSupport","modeling","translate"];class xx extends vx{render(){return vr(1,"div",this.getClassName(),this.getEditor(),0)}}function bx(e){e.onGetComponent("cell",(({cellType:e})=>"after-label-cells"===e?fv:"after-rule-cells"===e?yx:void 0))}bx.$inject=["components"];function _x(e){return function(t){return!1!==e?R(t,a(e)?e:300):t}}_x.$inject=["config.debounceInput"];var wx={debounceInput:["factory",_x]},Cx={__depends__:[wx],__init__:["annotationsProvider"],annotationsProvider:["type",bx]};function Ox(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kx=function(e,t){return e^t};var Ex=/\b(Array|Date|Object|Math|JSON)\b/g;var Sx=kx,Rx=function(e,t){var n=function(e){for(var t=[],n=0;n<e.length;n++)~t.indexOf(e[n])||t.push(e[n]);return t}(function(e){return e.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(Ex,"").match(/[a-zA-Z_]\w*/g)||[]}(e));return t&&"string"==typeof t&&(t=function(e){return function(t){return e+t}}(t)),t?function(e,t,n){var i=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return e.replace(i,(function(e){return"("==e[e.length-1]||~t.indexOf(e)?n(e):e}))}(e,n,t):n},Tx=Mx;function Mx(e,t){if(!(this instanceof Mx))return new Mx(e,t);if(this.node=this.start=this.peeked=e,this.root=t,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],e&&this.higher(e))throw new Error("root must be a parent or ancestor to node")}function Ax(e,t){var n="nextSibling"==e;return function(i,o,r){i=this.compile(i),o=o&&o>0?o:1;for(var s=this.node,a=this.closingTag,l=this._revisit;s;){if(Sx(n,a)&&s[t])s=s[t],a=!n;else if(1==s.nodeType&&!s[t]&&Sx(n,a)){if(a=n,!l)continue}else if(s[e])s=s[e],a=!n;else if(s=s.parentNode,a=n,!l)continue;if(!s||this.higher(s,this.root))break;if(i(s)&&this.selects(s,r)&&this.rejects(s,r)){if(--o)continue;return r||(this.node=s),this.closingTag=a,s}}return null}}Mx.prototype.reset=function(e){return this.node=e||this.start,this},Mx.prototype.revisit=function(e){return this._revisit=null==e||e,this},Mx.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},Mx.prototype.atOpening=function(){return!this.closingTag},Mx.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},Mx.prototype.atClosing=function(){return this.closingTag},Mx.prototype.next=Ax("nextSibling","firstChild"),Mx.prototype.previous=Mx.prototype.prev=Ax("previousSibling","lastChild"),Mx.prototype.select=function(e){return e=this.compile(e),this._selects.push(e),this},Mx.prototype.selects=function(e,t){var n=this._selects,i=n.length;if(!i)return!0;for(var o=0;o<i;o++)if(n[o].call(this,e,t))return!0;return!1},Mx.prototype.reject=function(e){return e=this.compile(e),this._rejects.push(e),this},Mx.prototype.rejects=function(e,t){var n=this._rejects,i=n.length;if(!i)return!0;for(var o=0;o<i;o++)if(n[o].call(this,e,t))return!1;return!0},Mx.prototype.higher=function(e){var t=this.root;if(!t)return!1;for(e=e.parentNode;e&&e!=t;)e=e.parentNode;return e!=t},Mx.prototype.compile=function(e){switch(typeof e){case"number":return function(t){return e==t.nodeType};case"string":return new Function("node","return "+Rx(e,"node."));case"function":return e;default:return function(){return!0}}},Mx.prototype.peak=Mx.prototype.peek=function(e,t){return 1==arguments.length&&(t=e,e=!0),(t=null==t?1:t)?t>0?this.next(e,t,!0):this.prev(e,Math.abs(t),!0):this.node},Mx.prototype.use=function(e){return e(this),this};var Px=Ox(Tx),Dx=window.getSelection();function $x(e){Dx.removeAllRanges(),Dx.addRange(e)}function jx(e,t){var n=function(e,t){var n,i=t.start,o=t.end,r=document.createRange(),s=Px(e.firstChild,e),a=s.node,l=!1,c=0;for(;a;){if(c===i&&(l?r.setStartAfter(a):r.setStartBefore(a)),c===o)return l?r.setEndAfter(a):r.setEndBefore(a),r;if(l||(Bx(a)||a.previousSibling&&(Lx(a)||Nx(a)))&&c++,Ix(a)){if(n=a.textContent.length,c<=i&&c+n>i&&r.setStart(a,i-c),c+n>o)return r.setEnd(a,o-c),r;c+=n}a=s.next(),l=s.closingTag}c<=i&&(e.lastChild?r.setStartAfter(e.lastChild):r.setStart(e,0));e.lastChild?r.setEndAfter(e.lastChild):r.setEnd(e,0);return r}(e,t);$x(n)}function Ix(e){return 3===e.nodeType}function Bx(e){return 1===e.nodeType&&"BR"===e.nodeName}function Lx(e){return 1===e.nodeType&&"DIV"===e.nodeName}function Nx(e){return 1===e.nodeType&&"P"===e.nodeName}function qx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vx={position:"absolute"};class Fx extends Ds{constructor(e,t){super(e,t),qx(this,"open",(({position:e,context:t})=>{this.close(),this.setState({isOpen:!0,position:e||{x:0,y:0},context:t||{}})})),qx(this,"close",(()=>{this.state.isOpen&&this.setState({context:void 0,isOpen:!1,position:{x:0,y:0}})})),qx(this,"triggerClose",(()=>{this.eventBus.fire("contextMenu.close")})),this.state={isOpen:!1,position:{x:0,y:0}},av(this)}componentDidMount(){this.eventBus.on("contextMenu.open",this.open),this.eventBus.on("contextMenu.close",this.close)}componentWillUnmount(){this.eventBus.off("contextMenu.open",this.open),this.eventBus.off("contextMenu.close",this.close)}render(){const{isOpen:e,context:t,position:n}=this.state;if(!e)return null;const i=this.components.getComponents("context-menu",t);return i.length?yr(2,zx,{className:"context-menu no-deselect",context:t,position:n,offset:t.offset||{x:0,y:0},autoFocus:!1!==t.autoFocus,autoClose:!1!==t.autoClose,components:i,onClose:this.triggerClose}):null}}Fx.$inject=["eventBus","components"];let zx=class extends Ds{constructor(e,t){super(e,t),qx(this,"onGlobalMouseDown",(e=>{this.checkClose(e.target)})),qx(this,"onGlobalKey",(e=>{var t=e.which;13!==t&&27!==t||(e.stopPropagation(),e.preventDefault(),this.close())})),qx(this,"onFocusChanged",(e=>{this.checkClose(e.target)})),qx(this,"setNode",(e=>{this.node=e;const{autoFocus:t}=this.props;var n;e&&(this.updatePosition(),t&&(n=Zt(Hx,e))&&(n.focus(),n.selectionStart&&"text"===n.type?n.selectionStart=1e5:"contentEditable"in n&&jx(n,{start:1e5,end:1e5})))})),av(this)}close(){const{onClose:e}=this.props;l(e)&&e()}checkClose(e){const{autoClose:t}=this.props;if(t){var n=this.node;n&&n!==e&&(n.contains(e)||this.close())}}componentDidMount(){document.addEventListener("focusin",this.onFocusChanged),document.addEventListener("keydown",this.onGlobalKey),document.addEventListener("mousedown",this.onGlobalMouseDown)}componentWillUnmount(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("keydown",this.onGlobalKey),document.removeEventListener("mousedown",this.onGlobalMouseDown)}updatePosition(){const{position:e,offset:t}=this.props,{node:n}=this,i=n.getBoundingClientRect();e.width||(e.width=0),e.height||(e.height=0);const o=this.renderer.getContainer().getBoundingClientRect();o.width>o.height?(this.node.classList.add("horizontal"),this.node.classList.remove("vertical")):(this.node.classList.add("vertical"),this.node.classList.remove("horizontal"));const{scrollLeft:r,scrollTop:s}=function(e){const t=Bt(e,".tjs-container");if(!t)return{scrollTop:0,scrollLeft:0};const{scrollLeft:n,scrollTop:i}=t;return{scrollTop:i,scrollLeft:n}}(n),a={};let l,c,u;e.align&&(l=e.align.split("-"));"left"===(l&&l[1]||(e.x+e.width/2>o.width/2?"left":"right"))?(c=e.x-o.left-i.width+t.x+r,n.classList.remove("right"),n.classList.add("left")):(c=-o.left+e.x+e.width-t.x+r,n.classList.remove("left"),n.classList.add("right")),c=l?c:Qx(c,0+r,o.width-i.width+r),a.left=c+"px";"top"===(l&&l[0]||(e.y+e.height/2>o.height/2?"top":"bottom"))?(u=e.y-o.top-i.height+t.y+s,n.classList.remove("bottom"),n.classList.add("top")):(u=-o.top+e.y-t.y+s,n.classList.remove("top"),n.classList.add("bottom")),u=l?u:Qx(u,0+s,o.height-i.height+s),a.top=u+"px",a.overflowY="auto",a.maxHeight=o.height-u+s+"px",M(this.node.style,Vx,a)}render(){const{context:e,components:t,className:n}=this.props;return vr(1,"div",n,t.map(((t,n)=>yr(2,t,{context:e},n))),0,{onContextMenu:e=>e.preventDefault()},null,this.setNode)}};function Qx(e,t,n){return Math.max(t,Math.min(n,e))}zx.$inject=["renderer"];const Hx="\n input[type=text],\n input[type=number],\n input[type=button],\n input[type=submit],\n [contenteditable],\n [tabindex],\n a[href],\n textarea,\n button\n";let Wx=class{constructor(e,t,n){this._eventBus=t,e.onGetComponent("table.before",(()=>Fx))}open(e,t){this._eventBus.fire("contextMenu.open",{position:e,context:t})}close(){this._eventBus.fire("contextMenu.close")}};Wx.$inject=["components","eventBus","renderer"];var Ux={__init__:["contextMenu"],contextMenu:["type",Wx]};function Xx(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Kx(e){return e.shiftKey}class Gx{constructor(e,t,n,i,o,r,s){this._clipboard=n,this._cellSelection=i,this._elementRegistry=o,this._editorActions=r,this._keyboard=e.get("keyboard",!1),this._renderer=s,this._keyboard&&(t.on("keyboard.init",this._registerBindings),t.on("keyboard.bind",(()=>{zt.bind(document,"copy",this._clearClipboard,!0),zt.bind(document,"cut",this._clearClipboard,!0)})),t.on("keyboard.unbind",(()=>{zt.unbind(document,"copy",this._clearClipboard,!0),zt.unbind(document,"cut",this._clearClipboard,!0)})))}_clearClipboard=()=>{this._clipboard.clear()};_getSelectedCell(){const e=this._cellSelection.getCellSelection();if(!e)return;const t=this._elementRegistry.get(e);if(!t)return;const n=My(e,this._renderer.getContainer()),i=Py(n);if(document.activeElement!==i)return;const o=wy(n);return o&&o.start!==o.end?void 0:t}_registerBindings=()=>{[(e,t)=>{if(Xx(t)&&67===e){const e=this._getSelectedCell();if(!e)return;return Kx(t)?this._editorActions.trigger("copy",{element:e.col}):this._editorActions.trigger("copy",{element:e.row}),!0}},(e,t)=>{if(Xx(t)&&88===e){const e=this._getSelectedCell();if(!e)return;return Kx(t)?this._editorActions.trigger("cut",{element:e.col}):this._editorActions.trigger("cut",{element:e.row}),!0}},(e,t)=>{let n;if(Xx(t)&&86===e){const e=this._getSelectedCell();if(!e)return;Kx(t)?(n=this._editorActions.trigger("pasteAfter",{element:e.col}),n&&this._cellSelection.selectCell("right")):(n=this._editorActions.trigger("pasteAfter",{element:e.row}),n&&this._cellSelection.selectCell("below"))}return void 0!==n}].forEach((e=>{this._keyboard.addListener(e)}))}}Gx.$inject=["injector","eventBus","clipboard","cellSelection","elementRegistry","editorActions","renderer"];var Yx={__depends__:[By,jy],__init__:["copyCutPasteKeyBindings"],copyCutPasteKeyBindings:["type",Gx]};class Zx extends Ds{constructor(e,t){super(e,t),av(this)}onClick=e=>{this.editorActions.trigger("addInput")};render(){return vr(1,"th","input-cell create-inputs header actionable",[this.translate("Input"),xr(" "),vr(1,"button","add-input dmn-icon-plus action-icon",null,1,{title:this.translate("Add input")})],0,{onClick:this.onClick,title:this.translate("Add input")})}}Zx.$inject=["editorActions","translate"];class Jx extends Ds{constructor(e,t){super(e,t),av(this)}onClick=e=>{this.editorActions.trigger("addInput")};render(){return vr(1,"td","input-cell create-inputs",xr("-"),2,{onClick:this.onClick,title:this.translate("Add input")})}}Jx.$inject=["editorActions","translate"];class eb{constructor(e,t){e.onGetComponent("cell",500,(({cellType:e})=>{const{businessObject:n}=t.getRoot();if(!n.input||!n.input.length)return"before-label-cells"===e?Zx:"before-rule-cells"===e?Jx:void 0}))}}eb.$inject=["components","sheet"];var tb={__depends__:[ax],__init__:["createInputsProvider"],createInputsProvider:["type",eb]};const nb=["string","boolean","number","date","time","dateTime","dayTimeDuration","yearMonthDuration","Any"];class ib{constructor(e){this._dataTypes=e||nb}getAll(){return this._dataTypes}}ib.$inject=["config.dataTypes"];var ob={__init__:["dataTypes"],dataTypes:["type",ib]};class rb{constructor(e,t,n,i,o,r,s,a,l,c,u){this._contextMenu=t,this._clipboard=n,this._editorActions=i,this._elementRegistry=r,this._eventBus=o,this._modeling=s,this._selection=a,this._sheet=l,this._rules=c,this._translate=u,this._getEntries=this._getEntries.bind(this),e.onGetComponent("context-menu",((t={})=>{if(t.contextMenuType&&"context-menu"===t.contextMenuType){const n=this._getEntries(t),i=function(e){return e instanceof Vm}(this._elementRegistry.get(t.id))&&e.getComponents("context-menu-cell-additional",t);if(i&&i.length){const e=vr(1,"div","context-menu-group context-menu-group-cell",i,0,{role:"presentation"});n.push(e)}return()=>vr(1,"div","context-menu-flex",n,0,{tabIndex:0,role:"menu","aria-label":"Decision table context menu"})}})),o.on("cell.contextmenu",(({event:e,id:n,node:i})=>{e.preventDefault(),t.open({x:e.pageX,y:e.pageY},{contextMenuType:"context-menu",event:e,id:n})}))}_getEntries(e){const t=t=>{const n=t.cells.map((e=>e.id)).indexOf(e.id),i=this._editorActions.trigger("addRuleAbove",{rule:t});i.cells[n]?this._selection.select(i.cells[n]):this._selection.select(i.cells[0]),this._contextMenu.close()},n=t=>{const n=t.cells.map((e=>e.id)).indexOf(e.id),i=this._editorActions.trigger("addRuleBelow",{rule:t});i.cells[n]?this._selection.select(i.cells[n]):this._selection.select(i.cells[0]),this._contextMenu.close()},i=e=>{this._editorActions.trigger("removeRule",{rule:e}),this._contextMenu.close()},o=e=>{this._editorActions.trigger("addInputLeft",{input:e}),this._contextMenu.close()},r=e=>{this._editorActions.trigger("addInputRight",{input:e}),this._contextMenu.close()},s=e=>{this._editorActions.trigger("removeInput",{input:e}),this._contextMenu.close()},a=e=>{this._editorActions.trigger("addOutputLeft",{output:e}),this._contextMenu.close()},l=e=>{this._editorActions.trigger("addOutputRight",{output:e}),this._contextMenu.close()},c=e=>{this._editorActions.trigger("removeOutput",{output:e}),this._contextMenu.close()},u=e=>{this._editorActions.trigger("copy",{element:e}),this._contextMenu.close()},h=e=>{this._editorActions.trigger("cut",{element:e}),this._contextMenu.close()},d=e=>{this._editorActions.trigger("pasteBefore",{element:e}),this._contextMenu.close()},p=e=>{this._editorActions.trigger("pasteAfter",{element:e}),this._contextMenu.close()},f=e&&e.id;if(!f)return null;const g=this._elementRegistry.get(f);if(!g)return null;const m=this._clipboard.get()||{},v=[],y=g.row||g;if(hn(y,"dmn:DecisionRule")){const e=this._rules.allowed("paste",{data:m.elements,target:y});v.push(vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-copy-rule",this._translate("Copy rule"),0,{onClick:()=>u(y),tabIndex:"-1",role:"menuitem"}),vr(1,"div","context-menu-group-entry context-menu-entry-cut-rule",this._translate("Cut rule"),0,{onClick:()=>h(y),tabIndex:"-1",role:"menuitem"}),vr(1,"div",`context-menu-group-entry ${e?"":"disabled"} context-menu-entry-paste-rule-above`,this._translate("Paste rule above"),0,{onClick:()=>d(y),tabIndex:"-1",role:"menuitem","aria-disabled":!e}),vr(1,"div",`context-menu-group-entry ${e?"":"disabled"} context-menu-entry-paste-rule-below`,this._translate("Paste rule below"),0,{onClick:()=>p(y),tabIndex:"-1",role:"menuitem","aria-disabled":!e})],4,{role:"presentation"}),vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-add-rule-above",this._translate("Add rule above"),0,{onClick:()=>t(y),tabIndex:"-1",role:"menuitem"}),vr(1,"div","context-menu-group-entry context-menu-entry-add-rule-below",this._translate("Add rule below"),0,{onClick:()=>n(y),tabIndex:"-1",role:"menuitem"}),vr(1,"div","context-menu-group-entry context-menu-entry-remove-rule",this._translate("Remove rule"),0,{onClick:()=>i(y),tabIndex:"-1",role:"menuitem"})],4,{role:"presentation"}))}else if(hn(g,"dmn:InputClause")){const e=hn(g,"dmn:InputClause")?g:g.col,t=this._rules.allowed("col.remove",{col:g.col||g}),n=this._rules.allowed("paste",{data:m.elements,target:g.col||g});v.push(vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-copy-input",this._translate("Copy input column"),0,{onClick:()=>u(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div",`context-menu-group-entry ${t?"":"disabled"} context-menu-entry-cut-input`,this._translate("Cut input column"),0,{onClick:()=>h(e),tabIndex:"-1",role:"menuitem","aria-disabled":!t}),vr(1,"div",`context-menu-group-entry ${n?"":"disabled"} context-menu-entry-paste-input-left`,this._translate("Paste input column left"),0,{onClick:()=>d(e),tabIndex:"-1",role:"menuitem","aria-disabled":!n}),vr(1,"div",`context-menu-group-entry ${n?"":"disabled"} context-menu-entry-paste-input-right`,this._translate("Paste input column right"),0,{onClick:()=>p(e),tabIndex:"-1",role:"menuitem","aria-disabled":!n})],4,{role:"presentation"}),vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-add-input-left",this._translate("Add input column left"),0,{onClick:()=>o(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div","context-menu-group-entry context-menu-entry-add-input-right",this._translate("Add input column right"),0,{onClick:()=>r(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div",`context-menu-group-entry ${t?"":"disabled"} context-menu-entry-remove-input`,this._translate("Remove input column"),0,{onClick:()=>s(e),tabIndex:"-1",role:"menuitem","aria-disabled":!t})],4,{role:"presentation"}))}else if(hn(g,"dmn:OutputClause")||hn(g.col,"dmn:OutputClause")){const e=hn(g,"dmn:OutputClause")?g:g.col,t=this._rules.allowed("col.remove",{col:g.col||g}),n=this._rules.allowed("paste",{data:m.elements,target:g.col||g});v.push(vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-copy-output",this._translate("Copy output column"),0,{onClick:()=>u(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div",`context-menu-group-entry ${t?"":"disabled"} context-menu-entry-cut-output`,this._translate("Cut output column"),0,{onClick:()=>h(e),tabIndex:"-1",role:"menuitem","aria-disabled":!t}),vr(1,"div",`context-menu-group-entry ${n?"":"disabled"} context-menu-entry-paste-output-left`,this._translate("Paste output column left"),0,{onClick:()=>d(e),tabIndex:"-1",role:"menuitem","aria-disabled":!n}),vr(1,"div",`context-menu-group-entry ${n?"":"disabled"} context-menu-entry-paste-output-right`,this._translate("Paste output column right"),0,{onClick:()=>p(e),tabIndex:"-1",role:"menuitem","aria-disabled":!n})],4,{role:"presentation"}),vr(1,"div","context-menu-group",[vr(1,"div","context-menu-group-entry context-menu-entry-add-output-left",this._translate("Add output column left"),0,{onClick:()=>a(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div","context-menu-group-entry context-menu-entry-add-output-right",this._translate("Add output column right"),0,{onClick:()=>l(e),tabIndex:"-1",role:"menuitem"}),vr(1,"div",`context-menu-group-entry ${t?"":"disabled"} context-menu-entry-remove-output`,this._translate("Remove output column"),0,{onClick:()=>c(e),tabIndex:"-1",role:"menuitem","aria-disabled":!t})],4,{role:"presentation"}))}return v}}rb.$inject=["components","contextMenu","clipboard","editorActions","eventBus","elementRegistry","modeling","selection","sheet","rules","translate"];const sb=["row.add","row.remove","col.add","col.remove"];class ab{constructor(e,t){t.on("commandStack.executed",(({command:t})=>{-1!==sb.indexOf(t)&&e.close()})),t.on("commandStack.reverted",(()=>{e.close()}))}}ab.$inject=["contextMenu","eventBus"];class lb{constructor(e){e.on("contextMenu.open",(()=>this.addEventListeners())),e.on("contextMenu.close",(()=>this.removeEventListeners())),e.on("commandStack.executed",(()=>this.removeEventListeners()))}addEventListeners=()=>{document.addEventListener("keydown",this.handleKeyEvent),document.addEventListener("mouseover",this.handleMouseOver)};removeEventListeners=()=>{document.removeEventListener("keydown",this.handleKeyEvent),document.removeEventListener("mouseover",this.handleMouseOver)};handleKeyEvent=e=>{"ArrowUp"===e.key?(e.preventDefault(),this.move(e.target,-1)):"ArrowDown"===e.key?(e.preventDefault(),this.move(e.target,1)):"Enter"===e.key&&(e.preventDefault(),this.clickCurrentEntry())};handleMouseOver=()=>{this.getEntries().forEach((e=>{return(t=e).style.removeProperty("background-color"),void t.style.removeProperty("pointer-events");var t}));const{focused:e}=this.getActiveEntries(document);e&&$t(e).remove("focused")};getEntries=()=>Array.from(Jt(".context-menu-group-entry")).filter((e=>!$t(e).has("disabled")));getActiveEntries=e=>{const t=Zt(".context-menu-group-entry:hover",e),n=Zt(".context-menu-group-entry.focused",e);return{hover:t,focused:n,current:n||t}};move=(e,t)=>{const n=this.getEntries(),{current:i,hover:o}=this.getActiveEntries(e);if(!i){return void $t(n[0]).add("focused")}const r=n.indexOf(i)+t;let s=n[r];var a;r<0&&(s=n[n.length-1]),r>=n.length&&(s=n[0]),o&&((a=o).style.setProperty("pointer-events","none"),a.style.setProperty("background-color","transparent")),$t(i).remove("focused"),$t(s).add("focused"),s.style.removeProperty("background-color")};clickCurrentEntry=()=>{const{current:e}=this.getActiveEntries(document);e&&e.click()}}lb.$inject=["eventBus"];var cb={__depends__:[ax,Ux,qy],__init__:["decisionTableContextMenu","contextMenuCloseBehavior","contextMenuKeyboard"],decisionTableContextMenu:["type",rb],contextMenuCloseBehavior:["type",ab],contextMenuKeyboard:["type",lb]};class ub extends Ds{constructor(e,t){super(e,t),cv(this,pv),this._translate=t.injector.get("translate")}onClick=e=>{const{output:t}=this.props;this._eventBus.fire("output.edit",{event:e,output:t})};onContextmenu=e=>{const{id:t}=this.props.output;this._eventBus.fire("cell.contextmenu",{event:e,id:t})};onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const{injector:e}=this.context;this._changeSupport=this.context.changeSupport,this._eventBus=e.get("eventBus"),this._elementRegistry=e.get("elementRegistry");const{output:t}=this.props;this._changeSupport.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){const{output:e}=this.props;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}render(){const{output:e,index:t,outputsLength:n}=this.props,{label:i,name:o,outputValues:r,typeRef:s}=e,a=e.width?e.width+"px":"192px";return vr(1,"th","output-cell output-editor",[this.slotFills({type:"cell-inner",context:{cellType:"output-cell",col:this._elementRegistry.get(e.id),index:t,outputsLength:n},col:e}),vr(1,"div","clause",0===t?this._translate("Then"):this._translate("And"),0),i?vr(1,"div","output-label",i,0,{title:this._translate("Output label: ")+i}):vr(1,"div","output-name",o,0,{title:this._translate("Output name: ")+o}),vr(1,"div","output-variable",r&&r.text||this._translate(s||""),0,{title:r&&r.text?this._translate("Output values"):this._translate("Output type")})],0,{"data-col-id":e.id,onDblClick:this.onClick,onContextMenu:this.onContextmenu,style:{width:a}})}}class hb extends Ds{constructor(e,t){super(e,t),this.state={value:e.value}}onInput=e=>{const{onInput:t}=this.props,n=e.target.value;this.setState({value:n},(()=>{"function"==typeof t&&t(n)}))};onChange=e=>{const{onChange:t}=this.props;"function"==typeof t&&t(e.target.value)};onKeyDown=e=>{const{onKeyDown:t}=this.props;"function"==typeof t&&t(e)};onKeyUp=e=>{const{onKeyUp:t}=this.props;"function"==typeof t&&t(e)};componentDidUpdate(e){const{value:t}=this.props;t!==e.value&&t!==this.state.value&&this.setState({value:t})}render(){const{className:e,label:t,id:n,placeholder:i,type:o}=this.props,{value:r}=this.state;return vr(64,"input",[e||"","dms-input"].join(" "),null,1,{"aria-label":t,placeholder:i||"",onChange:this.onChange,onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,spellCheck:"false",type:o||"text",value:r,id:n})}}class db extends Ds{constructor(e,t){super(e,t),this.translate=t.injector?t.injector.get("translate"):pb,this.setName=e=>{e=e||void 0,this.handleChange({name:e})},this.setLabel=e=>{e=e||void 0,this.handleChange({label:e})}}handleChange(e){var{onChange:t}=this.props;"function"==typeof t&&t(e)}render(){const{name:e,label:t}=this.props;return vr(1,"div","context-menu-container ref-output-editor output-edit",[vr(1,"div","dms-form-control",yr(2,gx,{label:this.translate("Output label"),className:"dms-output-label",value:t||"",placeholder:this.translate("Output"),singleLine:!0,onInput:this.setLabel}),2),vr(1,"div","dms-form-control",[vr(1,"label","dms-label",this.translate("Output name"),0),yr(2,hb,{label:this.translate("Output name"),className:"ref-output-name",value:e||"",onInput:this.setName})],4)],4)}}function pb(e){return e}class fb extends Ds{constructor(e,t){super(e,t),this.state={},av(this),this.persistChanges=this.debounceInput(this.persistChanges)}persistChanges=()=>{const{output:e}=this.props.context,{unsaved:t}=this.state;t&&(this.modeling.updateProperties(e,t),this.setState({unsaved:!1}))};handleChange=e=>{this.setState({unsaved:{...this.state.unsaved,...e}},this.persistChanges)};getValue(e){const{output:t}=this.props.context,{unsaved:n}=this.state;return n&&e in n?n[e]:t.get(e)}render(){return yr(2,db,{name:this.getValue("name"),label:this.getValue("label"),onChange:this.handleChange})}}fb.$inject=["debounceInput","modeling"];class gb extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._eventBus=t.injector.get("eventBus")}onClick=e=>{const{col:t}=this.props;this._eventBus.fire("output.edit",{event:e,output:t})};render(){return vr(1,"button","edit-button dmn-icon-edit",null,1,{"aria-label":this._translate("Edit output"),type:"button",onClick:this.onClick})}}class mb{constructor(e,t,n,i){e.onGetComponent("cell",(({cellType:e})=>{if("output-header"===e)return ub})),e.onGetComponent("context-menu",((e={})=>{if("output-edit"===e.contextMenuType)return fb})),e.onGetComponent("cell-inner",((e={})=>{const{cellType:t}=e;if("output-cell"===t)return gb})),n.on("output.edit",(({event:e,output:n})=>{const{target:i}=e,o=Bt(i,"th",!0),{left:r,top:s}=o.getBoundingClientRect(),a=function(e){if(!Yt(e,".output-cell + .output-cell"))return{x:-1,y:0}}(o);t.open({x:r,y:s,align:"bottom-right"},{contextMenuType:"output-edit",output:n,offset:a})}))}}mb.$inject=["components","contextMenu","eventBus","renderer"];class vb extends Ds{constructor(e,t){super(e,t),cv(this,pv),this._translate=t.injector.get("translate")}onClick=e=>{const{input:t}=this.props;this._eventBus.fire("input.edit",{event:e,input:t})};onContextmenu=e=>{const{id:t}=this.props.input;this._eventBus.fire("cell.contextmenu",{event:e,id:t})};onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const{injector:e}=this.context;this._changeSupport=this.context.changeSupport,this._sheet=e.get("sheet"),this._eventBus=e.get("eventBus"),this._elementRegistry=e.get("elementRegistry");const t=this._sheet.getRoot(),{input:n}=this.props;this._changeSupport.onElementsChanged(t.id,this.onElementsChanged),this._changeSupport.onElementsChanged(n.id,this.onElementsChanged)}componentWillUnmount(){const e=this._sheet.getRoot(),{input:t}=this.props;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged),this._changeSupport.offElementsChanged(t.id,this.onElementsChanged)}render(){const{input:e,index:t,inputsLength:n}=this.props,{inputExpression:i,inputValues:o}=e,r=e.get("label"),s=e.width?e.width+"px":"192px";return vr(1,"th","input-cell input-editor",[this.slotFills({type:"cell-inner",context:{cellType:"input-cell",col:this._elementRegistry.get(e.id),index:t,inputsLength:n},col:e}),vr(1,"div","clause",0===t?this._translate("When"):this._translate("And"),0),r?vr(1,"div","input-label",r,0,{title:this._translate("Input label: ")+r}):vr(1,"div","input-expression",i.text,0,{title:this._translate("Input expression: ")+i.text}),vr(1,"div","input-variable",o&&o.text||this._translate(i.typeRef||""),0,{title:o&&o.text?this._translate("Input values"):this._translate("Input type")})],0,{"data-col-id":e.id,onDblClick:this.onClick,onContextMenu:this.onContextmenu,style:{width:s}})}}let yb=[],xb=[];function bb(e){if(e<768)return!1;for(let t=0,n=yb.length;;){let i=t+n>>1;if(e<yb[i])n=i;else{if(!(e>=xb[i]))return!0;t=i+1}if(t==n)return!1}}function _b(e){return e>=127462&&e<=127487}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let t=0,n=0;t<e.length;t++)(t%2?xb:yb).push(n+=e[t])})();const wb=8205;function Cb(e,t,n=!0,i=!0){return(n?Ob:kb)(e,t,i)}function Ob(e,t,n){if(t==e.length)return t;t&&Sb(e.charCodeAt(t))&&Rb(e.charCodeAt(t-1))&&t--;let i=Eb(e,t);for(t+=Tb(i);t<e.length;){let o=Eb(e,t);if(i==wb||o==wb||n&&bb(o))t+=Tb(o),i=o;else{if(!_b(o))break;{let n=0,i=t-2;for(;i>=0&&_b(Eb(e,i));)n++,i-=2;if(n%2==0)break;t+=2}}}return t}function kb(e,t,n){for(;t>0;){let i=Ob(e,t-2,n);if(i<t)return i;t--}return 0}function Eb(e,t){let n=e.charCodeAt(t);if(!Rb(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Sb(i)?i-56320+(n-55296<<10)+65536:n}function Sb(e){return e>=56320&&e<57344}function Rb(e){return e>=55296&&e<56320}function Tb(e){return e<65536?1:2}class Mb{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Nb(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),Pb.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Nb(this,e,t);let n=[];return this.decompose(e,t,n,0),Pb.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new jb(this),o=new jb(e);for(let e=t,r=t;;){if(i.next(e),o.next(e),e=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(r+=i.value.length,i.done||r>=n)return!0}}iter(e=1){return new jb(this,e)}iterRange(e,t=this.length){return new Ib(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Bb(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new Ab(e):Pb.from(Ab.split(e,[])):Mb.empty}}class Ab extends Mb{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let o=0;;o++){let r=this.text[o],s=i+r.length;if((t?n:s)>=e)return new Lb(i,s,n,r);i=s+1,n++}}decompose(e,t,n,i){let o=e<=0&&t>=this.length?this:new Ab($b(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=Db(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new Ab(t,e.length+o.length));else{let e=t.length>>1;n.push(new Ab(t.slice(0,e)),new Ab(t.slice(e)))}}else n.push(o)}replace(e,t,n){if(!(n instanceof Ab))return super.replace(e,t,n);[e,t]=Nb(this,e,t);let i=Db(this.text,Db(n.text,$b(this.text,0,e)),t),o=this.length+n.length-(t-e);return i.length<=32?new Ab(i,o):Pb.from(Ab.split(i,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=Nb(this,e,t);let i="";for(let o=0,r=0;o<=t&&r<this.text.length;r++){let s=this.text[r],a=o+s.length;o>e&&r&&(i+=n),e<a&&t>o&&(i+=s.slice(Math.max(0,e-o),t-o)),o=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let o of e)n.push(o),i+=o.length+1,32==n.length&&(t.push(new Ab(n,i)),n=[],i=-1);return i>-1&&t.push(new Ab(n,i)),t}}class Pb extends Mb{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,i){for(let o=0;;o++){let r=this.children[o],s=i+r.length,a=n+r.lines-1;if((t?a:s)>=e)return r.lineInner(e,t,n,i);i=s+1,n=a+1}}decompose(e,t,n,i){for(let o=0,r=0;r<=t&&o<this.children.length;o++){let s=this.children[o],a=r+s.length;if(e<=a&&t>=r){let o=i&((r<=e?1:0)|(a>=t?2:0));r>=e&&a<=t&&!o?n.push(s):s.decompose(e-r,t-r,n,o)}r=a+1}}replace(e,t,n){if([e,t]=Nb(this,e,t),n.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let r=this.children[i],s=o+r.length;if(e>=o&&t<=s){let a=r.replace(e-o,t-o,n),l=this.lines-r.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let o=this.children.slice();return o[i]=a,new Pb(o,this.length-(t-e)+n.length)}return super.replace(o,s,a)}o=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=Nb(this,e,t);let i="";for(let o=0,r=0;o<this.children.length&&r<=t;o++){let s=this.children[o],a=r+s.length;r>e&&o&&(i+=n),e<a&&t>r&&(i+=s.sliceString(e-r,t-r,n)),r=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Pb))return 0;let n=0,[i,o,r,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,o+=t){if(i==r||o==s)return n;let a=this.children[i],l=e.children[o];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new Ab(n,t)}let i=Math.max(32,n>>5),o=i<<1,r=i>>1,s=[],a=0,l=-1,c=[];function u(e){let t;if(e.lines>o&&e instanceof Pb)for(let t of e.children)u(t);else e.lines>r&&(a>r||!a)?(h(),s.push(e)):e instanceof Ab&&a&&(t=c[c.length-1])instanceof Ab&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,c[c.length-1]=new Ab(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>i&&h(),a+=e.lines,l+=e.length+1,c.push(e))}function h(){0!=a&&(s.push(1==c.length?c[0]:Pb.from(c,l)),l=-1,a=c.length=0)}for(let t of e)u(t);return h(),1==s.length?s[0]:new Pb(s,t)}}function Db(e,t,n=0,i=1e9){for(let o=0,r=0,s=!0;r<e.length&&o<=i;r++){let a=e[r],l=o+a.length;l>=n&&(l>i&&(a=a.slice(0,i-o)),o<n&&(a=a.slice(n-o)),s?(t[t.length-1]+=a,s=!1):t.push(a)),o=l+1}return t}function $b(e,t,n){return Db(e,[""],t,n)}Mb.empty=new Ab([""],0);class jb{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Ab?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],o=this.offsets[n],r=o>>1,s=i instanceof Ab?i.text.length:i.children.length;if(r==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof Ab){let o=i.text[r+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=0==e?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=i.children[r+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof Ab?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ib{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new jb(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Bb{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Mb.prototype[Symbol.iterator]=function(){return this.iter()},jb.prototype[Symbol.iterator]=Ib.prototype[Symbol.iterator]=Bb.prototype[Symbol.iterator]=function(){return this});class Lb{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Nb(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function qb(e,t,n=!0,i=!0){return Cb(e,t,n,i)}function Vb(e,t){let n=e.charCodeAt(t);if(!(i=n,i>=55296&&i<56320&&t+1!=e.length))return n;var i;let o=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(o)?o-56320+(n-55296<<10)+65536:n}function Fb(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function zb(e){return e<65536?1:2}const Qb=/\r\n?|\n/;var Hb=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(Hb||(Hb={}));class Wb{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let o=this.sections[t++],r=this.sections[t++];r<0?(e(n,i,o),i+=o):i+=r,n+=o}}iterChangedRanges(e,t=!1){Gb(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new Wb(e)}composeDesc(e){return this.empty?e:e.empty?this:Zb(this,e)}mapDesc(e,t=!1){return e.empty?this:Yb(this,e,t)}mapPos(e,t=-1,n=Hb.Simple){let i=0,o=0;for(let r=0;r<this.sections.length;){let s=this.sections[r++],a=this.sections[r++],l=i+s;if(a<0){if(l>e)return o+(e-i);o+=s}else{if(n!=Hb.Simple&&l>=e&&(n==Hb.TrackDel&&i<e&&l>e||n==Hb.TrackBefore&&i<e||n==Hb.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==i||t<0?o:o+a;o+=a}i=l}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let o=i+this.sections[n++];if(this.sections[n++]>=0&&i<=t&&o>=e)return!(i<e&&o>t)||"cover";i=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Wb(e)}static create(e){return new Wb(e)}}class Ub extends Wb{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gb(this,((t,n,i,o,r)=>e=e.replace(i,i+(n-t),r)),!1),e}mapDesc(e,t=!1){return Yb(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,o=0;i<t.length;i+=2){let r=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=r;let a=i>>1;for(;n.length<a;)n.push(Mb.empty);n.push(r?e.slice(o,o+r):Mb.empty)}o+=r}return new Ub(t,n)}compose(e){return this.empty?e:e.empty?this:Zb(this,e,!0)}map(e,t=!1){return e.empty?this:Yb(this,e,t,!0)}iterChanges(e,t=!1){Gb(this,e,t)}get desc(){return Wb.create(this.sections)}filter(e){let t=[],n=[],i=[],o=new Jb(this);e:for(let r=0,s=0;;){let a=r==e.length?1e9:e[r++];for(;s<a||s==a&&0==o.len;){if(o.done)break e;let e=Math.min(o.len,a-s);Xb(i,e,-1);let r=-1==o.ins?-1:0==o.off?o.ins:0;Xb(t,e,r),r>0&&Kb(n,t,o.text),o.forward(e),s+=e}let l=e[r++];for(;s<l;){if(o.done)break e;let e=Math.min(o.len,l-s);Xb(t,e,-1),Xb(i,e,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(e),s+=e}}return{changes:new Ub(t,n),filtered:Wb.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],o=[],r=0,s=null;function a(e=!1){if(!e&&!i.length)return;r<t&&Xb(i,t-r,-1);let n=new Ub(i,o);s=s?s.compose(n.map(s)):n,i=[],o=[],r=0}return function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof Ub){if(l.length!=t)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:c}=l;if(e>s||e<0||s>t)throw new RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let u=c?"string"==typeof c?Mb.of(c.split(n||Qb)):c:Mb.empty,h=u.length;if(e==s&&0==h)return;e<r&&a(),e>r&&Xb(i,e-r,-1),Xb(i,s-e,h),Kb(o,i,u),r=s}}(e),a(!s),s}static empty(e){return new Ub(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let o=e[i];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some(((e,t)=>t&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;n.length<i;)n.push(Mb.empty);n[i]=Mb.of(o.slice(1)),t.push(o[0],n[i].length)}}}return new Ub(t,n)}static createSet(e,t){return new Ub(e,t)}}function Xb(e,t,n,i=!1){if(0==t&&n<=0)return;let o=e.length-2;o>=0&&n<=0&&n==e[o+1]?e[o]+=t:o>=0&&0==t&&0==e[o]?e[o+1]+=n:i?(e[o]+=t,e[o+1]+=n):e.push(t,n)}function Kb(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(Mb.empty);e.push(n)}}function Gb(e,t,n){let i=e.inserted;for(let o=0,r=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)o+=a,r+=a;else{let c=o,u=r,h=Mb.empty;for(;c+=a,u+=l,l&&i&&(h=h.append(i[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(o,c,r,u,h),o=c,r=u}}}function Yb(e,t,n,i=!1){let o=[],r=i?[]:null,s=new Jb(e),a=new Jb(t);for(let e=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);Xb(o,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(Xb(o,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(Xb(o,0,s.ins),r&&Kb(r,o,s.text),e=s.i),s.forward(n),t-=n}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return r?Ub.createSet(o,r):Wb.create(o);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<n))break;n-=a.len,a.next()}Xb(o,t,e<s.i?s.ins:0),r&&e<s.i&&Kb(r,o,s.text),e=s.i,s.forward(s.len-n)}}}}function Zb(e,t,n=!1){let i=[],o=n?[]:null,r=new Jb(e),s=new Jb(t);for(let e=!1;;){if(r.done&&s.done)return o?Ub.createSet(i,o):Wb.create(i);if(0==r.ins)Xb(i,r.len,0,e),r.next();else if(0!=s.len||s.done){if(r.done||s.done)throw new Error("Mismatched change set lengths");{let t=Math.min(r.len2,s.len),n=i.length;if(-1==r.ins){let n=-1==s.ins?-1:s.off?0:s.ins;Xb(i,t,n,e),o&&n&&Kb(o,i,s.text)}else-1==s.ins?(Xb(i,r.off?0:r.len,t,e),o&&Kb(o,i,r.textBit(t))):(Xb(i,r.off?0:r.len,s.off?0:s.ins,e),o&&!s.off&&Kb(o,i,s.text));e=(r.ins>t||s.ins>=0&&s.len>t)&&(e||i.length>n),r.forward2(t),s.forward(t)}}else Xb(i,0,s.ins,e),o&&Kb(o,i,s.text),s.next()}}class Jb{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Mb.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Mb.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class e_{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new e_(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return t_.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return t_.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return t_.range(e.anchor,e.head)}static create(e,t,n){return new e_(e,t,n)}}class t_{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:t_.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new t_([this.main],0)}addRange(e,t=!0){return t_.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,t_.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((e=>e.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t_(e.ranges.map((e=>e_.fromJSON(e))),e.main)}static single(e,t=e){return new t_([t_.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=n:o.from<n)return t_.normalized(e.slice(),t);n=o.to}return new t_(e,t)}static cursor(e,t=0,n,i){return e_.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(e,t,n,i){let o=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return t<e?e_.create(t,e,48|o):e_.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],o=e[n-1];if(i.empty?i.from<=o.to:i.from<o.to){let r=o.from,s=Math.max(i.to,o.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?t_.range(s,r):t_.range(r,s))}}return new t_(e,t)}}function n_(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let i_=0;class o_{constructor(e,t,n,i,o){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=i_++,this.default=e([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(e={}){return new o_(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:r_),!!e.static,e.enables)}of(e){return new s_([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new s_(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new s_(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function r_(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class s_{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=i_++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,o=this.id,r=e[o]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[r]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||l_(e,c)){let t=n(e);if(s?!a_(t,e.values[r],i):!i(t,e.values[r]))return e.values[r]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[o];if(null!=l){let o=C_(t,l);if(this.dependencies.every((n=>n instanceof o_?t.facet(n)===e.facet(n):!(n instanceof h_)||t.field(n,!1)==e.field(n,!1)))||(s?a_(a=n(e),o,i):i(a=n(e),o)))return e.values[r]=o,0}else a=n(e);return e.values[r]=a,1}}}}function a_(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function l_(e,t){let n=!1;for(let i of t)1&w_(e,i)&&(n=!0);return n}function c_(e,t,n){let i=n.map((t=>e[t.id])),o=n.map((e=>e.type)),r=i.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<i.length;t++){let r=C_(e,i[t]);if(2==o[t])for(let e of r)n.push(e);else n.push(r)}return t.combine(n)}return{create(e){for(let t of i)w_(e,t);return e.values[s]=a(e),1},update(e,n){if(!l_(e,r))return 0;let i=a(e);return t.compare(i,e.values[s])?0:(e.values[s]=i,1)},reconfigure(e,o){let r=l_(e,i),l=o.config.facets[t.id],c=o.facet(t);if(l&&!r&&r_(n,l))return e.values[s]=c,0;let u=a(e);return t.compare(u,c)?(e.values[s]=c,0):(e.values[s]=u,1)}}}const u_=o_.define({static:!0});class h_{constructor(e,t,n,i,o){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let t=new h_(i_++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(u_).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],o=this.updateF(i,n);return this.compareF(i,o)?0:(e.values[t]=o,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,u_.of({field:this,create:e})]}get extension(){return this}}const d_=4,p_=3,f_=2,g_=1;function m_(e){return t=>new y_(t,e)}const v_={highest:m_(0),high:m_(g_),default:m_(f_),low:m_(p_),lowest:m_(d_)};class y_{constructor(e,t){this.inner=e,this.prec=t}}class x_{of(e){return new b_(this,e)}reconfigure(e){return x_.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class b_{constructor(e,t){this.compartment=e,this.inner=t}}class __{constructor(e,t,n,i,o,r){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=o,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],o=Object.create(null),r=new Map;for(let n of function(e,t,n){let i=[[],[],[],[],[]],o=new Map;function r(e,s){let a=o.get(e);if(null!=a){if(a<=s)return;let t=i[a].indexOf(e);t>-1&&i[a].splice(t,1),e instanceof b_&&n.delete(e.compartment)}if(o.set(e,s),Array.isArray(e))for(let t of e)r(t,s);else if(e instanceof b_){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=t.get(e.compartment)||e.inner;n.set(e.compartment,i),r(i,s)}else if(e instanceof y_)r(e.inner,e.prec);else if(e instanceof h_)i[s].push(e),e.provides&&r(e.provides,s);else if(e instanceof s_)i[s].push(e),e.facet.extensions&&r(e.facet.extensions,f_);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(t,s)}}return r(e,f_),i.reduce(((e,t)=>e.concat(t)))}(e,t,r))n instanceof h_?i.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],i=t[0].facet,r=c&&c[e]||[];if(t.every((e=>0==e.type)))if(s[i.id]=a.length<<1|1,r_(r,t))a.push(n.facet(i));else{let e=i.combine(t.map((e=>e.value)));a.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));s[i.id]=l.length<<1,l.push((e=>c_(e,i,t)))}}let u=l.map((e=>e(s)));return new __(e,r,u,s,a,o)}}function w_(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let o=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|o}function C_(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const O_=o_.define(),k_=o_.define({combine:e=>e.some((e=>e)),static:!0}),E_=o_.define({combine:e=>e.length?e[0]:void 0,static:!0}),S_=o_.define(),R_=o_.define(),T_=o_.define(),M_=o_.define({combine:e=>!!e.length&&e[0]});class A_{constructor(e,t){this.type=e,this.value=t}static define(){return new P_}}class P_{of(e){return new A_(this,e)}}class D_{constructor(e){this.map=e}of(e){return new $_(this,e)}}class $_{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new $_(this.type,t)}is(e){return this.type==e}static define(e={}){return new D_(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}$_.reconfigure=$_.define(),$_.appendConfig=$_.define();class j_{constructor(e,t,n,i,o,r){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=o,this.scrollIntoView=r,this._doc=null,this._state=null,n&&n_(n,t.newLength),o.some((e=>e.type==j_.time))||(this.annotations=o.concat(j_.time.of(Date.now())))}static create(e,t,n,i,o,r){return new j_(e,t,n,i,o,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(j_.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function I_(e,t){let n=[];for(let i=0,o=0;;){let r,s;if(i<e.length&&(o==t.length||t[o]>=e[i]))r=e[i++],s=e[i++];else{if(!(o<t.length))return n;r=t[o++],s=t[o++]}!n.length||n[n.length-1]<r?n.push(r,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function B_(e,t,n){var i;let o,r,s;return n?(o=t.changes,r=Ub.empty(t.changes.length),s=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),r=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(o)),{changes:s,selection:t.selection?t.selection.map(r):null===(i=e.selection)||void 0===i?void 0:i.map(o),effects:$_.mapEffects(e.effects,o).concat($_.mapEffects(t.effects,r)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function L_(e,t,n){let i=t.selection,o=V_(t.annotations);return t.userEvent&&(o=o.concat(j_.userEvent.of(t.userEvent))),{changes:t.changes instanceof Ub?t.changes:Ub.of(t.changes||[],n,e.facet(E_)),selection:i&&(i instanceof t_?i:t_.single(i.anchor,i.head)),effects:V_(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function N_(e,t,n){let i=L_(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let o=1;o<t.length;o++){!1===t[o].filter&&(n=!1);let r=!!t[o].sequential;i=B_(i,L_(e,t[o],r?i.changes.newLength:e.doc.length),r)}let o=j_.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(T_),i=e;for(let o=n.length-1;o>=0;o--){let r=n[o](e);r&&Object.keys(r).length&&(i=B_(i,L_(t,r,e.changes.newLength),!0))}return i==e?e:j_.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let i of t.facet(S_)){let t=i(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:I_(n,t))}if(!0!==n){let i,o;if(!1===n)o=e.changes.invertedDesc,i=Ub.empty(t.doc.length);else{let t=e.changes.filter(n);i=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=j_.create(t,i,e.selection&&e.selection.map(o),$_.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let i=t.facet(R_);for(let n=i.length-1;n>=0;n--){let o=i[n](e);e=o instanceof j_?o:Array.isArray(o)&&1==o.length&&o[0]instanceof j_?o[0]:N_(t,V_(o),!1)}return e}(o):o)}j_.time=A_.define(),j_.userEvent=A_.define(),j_.addToHistory=A_.define(),j_.remote=A_.define();const q_=[];function V_(e){return null==e?q_:Array.isArray(e)?e:[e]}var F_=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(F_||(F_={}));const z_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Q_;try{Q_=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Ih){}function H_(e){return t=>{if(!/\S/.test(t))return F_.Space;if(function(e){if(Q_)return Q_.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||z_.test(n)))return!0}return!1}(t))return F_.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return F_.Word;return F_.Other}}class W_{constructor(e,t,n,i,o,r){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,r&&(r._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)w_(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return w_(this,n),C_(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return N_(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:o}=n;for(let t of e.effects)t.is(x_.reconfigure)?(n&&(o=new Map,n.compartments.forEach(((e,t)=>o.set(t,e))),n=null),o.set(t.value.compartment,t.value.extension)):t.is($_.reconfigure)?(n=null,i=t.value):t.is($_.appendConfig)&&(n=null,i=V_(i).concat(t.value));if(n)t=e.startState.values.slice();else{n=__.resolve(i,o,this),t=new W_(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values}let r=e.startState.facet(k_)?e.newSelection:e.newSelection.asSingle();new W_(n,e.newDoc,r,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:t_.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),o=[n.range],r=V_(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(i);for(let e=0;e<n;e++)o[e]=o[e].map(l);let c=i.mapDesc(a,!0);o.push(s.range.map(c)),i=i.compose(l),r=$_.mapEffects(r,l).concat($_.mapEffects(V_(s.effects),c))}return{changes:i,selection:t_.create(o,t.mainIndex),effects:r}}changes(e=[]){return e instanceof Ub?e:Ub.of(e,this.doc.length,this.facet(W_.lineSeparator))}toText(e){return Mb.of(e.split(this.facet(W_.lineSeparator)||Qb))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(w_(this,t),C_(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof h_&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let o=n[t],r=e[t];i.push(o.init((e=>o.spec.fromJSON(r,e))))}return W_.create({doc:e.doc,selection:t_.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=__.resolve(e.extensions||[],new Map),n=e.doc instanceof Mb?e.doc:Mb.of((e.doc||"").split(t.staticFacet(W_.lineSeparator)||Qb)),i=e.selection?e.selection instanceof t_?e.selection:t_.single(e.selection.anchor,e.selection.head):t_.single(0);return n_(i,n.length),t.staticFacet(k_)||(i=i.asSingle()),new W_(t,n,i,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(W_.tabSize)}get lineBreak(){return this.facet(W_.lineSeparator)||"\n"}get readOnly(){return this.facet(M_)}phrase(e,...t){for(let t of this.facet(W_.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]}))),e}languageDataAt(e,t,n=-1){let i=[];for(let o of this.facet(O_))for(let r of o(this,t,n))Object.prototype.hasOwnProperty.call(r,e)&&i.push(r[e]);return i}charCategorizer(e){return H_(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),r=e-n,s=e-n;for(;r>0;){let e=qb(t,r,!1);if(o(t.slice(e,r))!=F_.Word)break;r=e}for(;s<i;){let e=qb(t,s);if(o(t.slice(s,e))!=F_.Word)break;s=e}return r==s?null:t_.range(r+n,s+n)}}function U_(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let o=t[e],r=i[e];if(void 0===r)i[e]=o;else if(r===o||void 0===o);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);i[e]=n[e](r,o)}}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}W_.allowMultipleSelections=k_,W_.tabSize=o_.define({combine:e=>e.length?e[0]:4}),W_.lineSeparator=E_,W_.readOnly=M_,W_.phrases=o_.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every((n=>e[n]==t[n]))}}),W_.languageData=O_,W_.changeFilter=S_,W_.transactionFilter=R_,W_.transactionExtender=T_,x_.reconfigure=$_.define();class X_{eq(e){return this==e}range(e,t=e){return K_.create(e,t,this)}}X_.prototype.startSide=X_.prototype.endSide=0,X_.prototype.point=!1,X_.prototype.mapMode=Hb.TrackDel;let K_=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,i){return new e(t,n,i)}};function G_(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Y_{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let o=n?this.to:this.from;for(let r=i,s=o.length;;){if(r==s)return r;let i=r+s>>1,a=o[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==r)return a>=0?r:s;a>=0?s=i:r=i+1}}between(e,t,n,i){for(let o=this.findIndex(t,-1e9,!0),r=this.findIndex(n,1e9,!1,o);o<r;o++)if(!1===i(this.from[o]+e,this.to[o]+e,this.value[o]))return!1}map(e,t){let n=[],i=[],o=[],r=-1,s=-1;for(let a=0;a<this.value.length;a++){let l,c,u=this.value[a],h=this.from[a]+e,d=this.to[a]+e;if(h==d){let e=t.mapPos(h,u.startSide,u.mapMode);if(null==e)continue;if(l=c=e,u.startSide!=u.endSide&&(c=t.mapPos(h,u.endSide),c<l))continue}else if(l=t.mapPos(h,u.startSide),c=t.mapPos(d,u.endSide),l>c||l==c&&u.startSide>0&&u.endSide<=0)continue;(c-l||u.endSide-u.startSide)<0||(r<0&&(r=l),u.point&&(s=Math.max(s,c-l)),n.push(u),i.push(l-r),o.push(c-r))}return{mapped:n.length?new Y_(i,o,n,s):null,pos:r}}}class Z_{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Z_(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:o=this.length}=e,r=e.filter;if(0==t.length&&!r)return this;if(n&&(t=t.slice().sort(G_)),this.isEmpty)return t.length?Z_.of(t):this;let s=new tw(this,null,-1).goto(0),a=0,l=[],c=new J_;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!r||i>this.chunkEnd(s.chunkIndex)||o<this.chunkPos[s.chunkIndex])&&c.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!r||i>s.to||o<s.from||r(s.from,s.to,s.value))&&(c.addInner(s.from,s.to,s.value)||l.push(K_.create(s.from,s.to,s.value))),s.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Z_.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let o=0;o<this.chunk.length;o++){let r=this.chunkPos[o],s=this.chunk[o],a=e.touchesRange(r,r+s.length);if(!1===a)i=Math.max(i,s.maxPoint),t.push(s),n.push(e.mapPos(r));else if(!0===a){let{mapped:o,pos:a}=s.map(r,e);o&&(i=Math.max(i,o.maxPoint),t.push(o),n.push(a))}}let o=this.nextLayer.map(e);return 0==t.length?o:new Z_(n,t,o||Z_.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],r=this.chunk[i];if(t>=o&&e<=o+r.length&&!1===r.between(o,e-o,t-o,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return nw.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return nw.from(e).goto(t)}static compare(e,t,n,i,o=-1){let r=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o)),a=ew(r,s,n),l=new ow(r,a,o),c=new ow(s,a,o);n.iterGaps(((e,t,n)=>rw(l,e,c,t,n,i))),n.empty&&0==n.length&&rw(l,0,c,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),r=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(o.length!=r.length)return!1;if(!o.length)return!0;let s=ew(o,r),a=new ow(o,s,0).goto(n),l=new ow(r,s,0).goto(n);for(;;){if(a.to!=l.to||!sw(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(e,t,n,i,o=-1){let r=new ow(e,null,o).goto(t),s=t,a=r.openStart;for(;;){let e=Math.min(r.to,n);if(r.point){let n=r.activeForPoint(r.to),o=r.pointFrom<t?n.length+1:r.point.startSide<0?n.length:Math.min(n.length,a);i.point(s,e,r.point,n,o,r.pointRank),a=Math.min(r.openEnd(e),n.length)}else e>s&&(i.span(s,e,r.active,a),a=r.openEnd(e));if(r.to>n)return a+(r.point&&r.to>n?1:0);s=r.to,r.next()}}static of(e,t=!1){let n=new J_;for(let i of e instanceof K_?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(G_(t,i)>0)return e.slice().sort(G_);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Z_.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Z_.empty;i=i.nextLayer)t=new Z_(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Z_.empty=new Z_([],[],null,-1),Z_.empty.nextLayer=Z_.empty;class J_{finishChunk(e){this.chunks.push(new Y_(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new J_)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Z_.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Z_.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function ew(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let o=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let r=i.get(e.chunk[t]);null==r||(n?n.mapPos(r):r)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(r,r+e.chunk[t].length))||o.add(e.chunk[t])}return o}class tw{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class nw{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let o=0;o<e.length;o++)for(let r=e[o];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new tw(r,t,n,o));return 1==i.length?i[0]:new nw(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)iw(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)iw(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),iw(this.heap,0)}}}function iw(e,t){for(let n=e[t];;){let i=1+(t<<1);if(i>=e.length)break;let o=e[i];if(i+1<e.length&&o.compare(e[i+1])>=0&&(o=e[i+1],i++),n.compare(o)<0)break;e[i]=n,e[t]=o,t=i}}class ow{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=nw.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){aw(this.active,e),aw(this.activeTo,e),aw(this.activeRank,e),this.minActive=cw(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||i-this.activeTo[t])>0;)t++;lw(this.active,t,n),lw(this.activeTo,t,i),lw(this.activeRank,t,o),e&&lw(e,t,this.cursor.from),this.minActive=cw(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&aw(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function rw(e,t,n,i,o,r){e.goto(t),n.goto(i);let s=i+o,a=i,l=i-t;for(;;){let t=e.to+l-n.to,i=t||e.endSide-n.endSide,o=i<0?e.to+l:n.to,c=Math.min(o,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&sw(e.activeForPoint(e.to),n.activeForPoint(n.to))||r.comparePoint(a,c,e.point,n.point):c>a&&!sw(e.active,n.active)&&r.compareRange(a,c,e.active,n.active),o>s)break;(t||e.openEnd!=n.openEnd)&&r.boundChange&&r.boundChange(o),a=o,i<=0&&e.next(),i>=0&&n.next()}}function sw(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function aw(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function lw(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function cw(e,t){let n=-1,i=1e9;for(let o=0;o<t.length;o++)(t[o]-i||e[o].endSide-e[n].endSide)<0&&(n=o,i=t[o]);return n}function uw(e,t,n=e.length){let i=0;for(let o=0;o<n&&o<e.length;)9==e.charCodeAt(o)?(i+=t-i%t,o++):(i++,o=qb(e,o));return i}const hw="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),dw="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),pw="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class fw{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function o(e,t,r,s){let a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return r.push(e[0]+";");for(let n in t){let s=t[n];if(/&/.test(n))o(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),s,r);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");o(i(n),s,a,c)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+s+";")}(a.length||c)&&r.push((!n||l||s?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)o(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=pw[hw]||1;return pw[hw]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[dw],o=n&&n.nonce;i?o&&i.setNonce(o):i=new mw(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let gw=new Map;class mw{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=gw.get(n);if(t)return e[dw]=t;this.sheet=new i.CSSStyleSheet,gw.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[dw]=this}mount(e,t){let n=this.sheet,i=0,o=0;for(let t=0;t<e.length;t++){let r=e[t],s=this.modules.indexOf(r);if(s<o&&s>-1&&(this.modules.splice(s,1),o--,s=-1),-1==s){if(this.modules.splice(o++,0,r),n)for(let e=0;e<r.rules.length;e++)n.insertRule(r.rules[e],i++)}else{for(;o<s;)i+=this.modules[o++].rules.length;i+=r.rules.length,o++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var vw={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},yw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xw="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),bw="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_w=0;_w<10;_w++)vw[48+_w]=vw[96+_w]=String(_w);for(_w=1;_w<=24;_w++)vw[_w+111]="F"+_w;for(_w=65;_w<=90;_w++)vw[_w]=String.fromCharCode(_w+32),yw[_w]=String.fromCharCode(_w);for(var ww in vw)yw.hasOwnProperty(ww)||(yw[ww]=vw[ww]);function Cw(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Ow(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function kw(e,t){if(!t.anchorNode)return!1;try{return Ow(e,t.anchorNode)}catch(e){return!1}}function Ew(e){return 3==e.nodeType?Nw(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Sw(e,t,n,i){return!!n&&(Mw(e,t,n,i,-1)||Mw(e,t,n,i,1))}function Rw(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Tw(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Mw(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:Aw(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=Rw(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?Aw(e):0}}}function Aw(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pw(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Dw(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function $w(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}class jw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Aw(t):0),n,Math.min(e.focusOffset,n?Aw(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let Iw,Bw=null;function Lw(e){if(e.setActive)return e.setActive();if(Bw)return e.focus(Bw);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Bw?{get preventScroll(){return Bw={preventScroll:!0},!0}}:void 0),!Bw){Bw=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],o=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=o&&(n.scrollLeft=o)}}}function Nw(e,t,n=t){let i=Iw||(Iw=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function qw(e,t,n,i){let o={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=i);let r=new KeyboardEvent("keydown",o);r.synthetic=!0,e.dispatchEvent(r);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,e.dispatchEvent(s),r.defaultPrevented||s.defaultPrevented}function Vw(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function Fw(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function zw(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i>0)return{node:n,offset:i};if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;n=n.childNodes[i-1],i=Aw(n)}else{if(!n.parentNode||Tw(n))return null;i=Rw(n),n=n.parentNode}}}function Qw(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||Tw(n))return null;i=Rw(n)+1,n=n.parentNode}}}class Hw{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Hw(e.parentNode,Rw(e),t)}static after(e,t){return new Hw(e.parentNode,Rw(e)+1,t)}}const Ww=[];class Uw{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,i=this.dom,o=null;for(let r of this.children){if(7&r.flags){if(!r.dom&&(n=o?o.nextSibling:i.firstChild)){let e=Uw.get(n);(!e||!e.parent&&e.canReuseDOM(r))&&r.reuseDOM(n)}r.sync(e,t),r.flags&=-8}if(n=o?o.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&n!=r.dom&&(t.written=!0),r.dom.parentNode==i)for(;n&&n!=r.dom;)n=Xw(n);else i.insertBefore(r.dom,n);o=r.dom}for(n=o?o.nextSibling:i.firstChild,n&&t&&t.node==i&&(t.written=!0);n;)n=Xw(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=0==Aw(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}n=i<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!Uw.get(n);)n=n.nextSibling;if(!n)return this.length;for(let e=0,t=0;;e++){let i=this.children[e];if(i.dom==n)return t;t+=i.length+i.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,o=-1,r=-1,s=-1;for(let a=0,l=n,c=n;a<this.children.length;a++){let n=this.children[a],u=l+n.length;if(l<e&&u>t)return n.domBoundsAround(e,t,l);if(u>=e&&-1==i&&(i=a,o=l),l>t&&n.dom.parentNode==this.dom){r=a,s=c;break}c=u,l=u+n.breakAfter}return{from:o,to:s<0?n+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:r<this.children.length&&r>=0?this.children[r].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Ww){this.markDirty();for(let i=e;i<t;i++){let e=this.children[i];e.parent==this&&n.indexOf(e)<0&&e.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Kw(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,i,o,r){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function Xw(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}Uw.prototype.breakAfter=0;class Kw{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Gw(e,t,n,i,o,r,s,a,l){let{children:c}=e,u=c.length?c[t]:null,h=r.length?r[r.length-1]:null,d=h?h.breakAfter:s;if(!(t==i&&u&&!s&&!d&&r.length<2&&u.merge(n,o,r.length?h:null,0==n,a,l))){if(i<c.length){let e=c[i];e&&(o<e.length||e.breakAfter&&(null==h?void 0:h.breakAfter))?(t==i&&(e=e.split(o),o=0),!d&&h&&e.merge(0,o,h,!0,0,l)?r[r.length-1]=e:((o||e.children.length&&!e.children[0].length)&&e.merge(0,o,null,!1,0,l),r.push(e))):(null==e?void 0:e.breakAfter)&&(h?h.breakAfter=1:s=1),i++}for(u&&(u.breakAfter=s,n>0&&(!s&&r.length&&u.merge(n,u.length,r[0],!1,a,0)?u.breakAfter=r.shift().breakAfter:(n<u.length||u.children.length&&0==u.children[u.children.length-1].length)&&u.merge(n,u.length,null,!1,a,0),t++));t<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),l=r.length?0:a;else{if(!c[t].become(r[0]))break;t++,r.shift(),a=r.length?0:l}!r.length&&t&&i<c.length&&!c[t-1].breakAfter&&c[i].merge(0,0,c[t-1],!1,a,l)&&t--,(t<i||r.length)&&e.replaceChildren(t,i,r)}}function Yw(e,t,n,i,o,r){let s=e.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:u}=s.findPos(t,-1),h=t-n;for(let e of i)h+=e.length;e.length+=h,Gw(e,c,u,a,l,i,0,o,r)}let Zw="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Jw="undefined"!=typeof document?document:{documentElement:{style:{}}};const eC=/Edge\/(\d+)/.exec(Zw.userAgent),tC=/MSIE \d/.test(Zw.userAgent),nC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zw.userAgent),iC=!!(tC||nC||eC),oC=!iC&&/gecko\/(\d+)/i.test(Zw.userAgent),rC=!iC&&/Chrome\/(\d+)/.exec(Zw.userAgent),sC="webkitFontSmoothing"in Jw.documentElement.style,aC=!iC&&/Apple Computer/.test(Zw.vendor),lC=aC&&(/Mobile\/\w+/.test(Zw.userAgent)||Zw.maxTouchPoints>2);var cC={mac:lC||/Mac/.test(Zw.platform),windows:/Win/.test(Zw.platform),linux:/Linux|X11/.test(Zw.platform),ie:iC,ie_version:tC?Jw.documentMode||6:nC?+nC[1]:eC?+eC[1]:0,gecko:oC,gecko_version:oC?+(/Firefox\/(\d+)/.exec(Zw.userAgent)||[0,0])[1]:0,chrome:!!rC,chrome_version:rC?+rC[1]:0,ios:lC,android:/Android\b/.test(Zw.userAgent),webkit:sC,safari:aC,webkit_version:sC?+(/\bAppleWebKit\/(\d+)/.exec(Zw.userAgent)||[0,0])[1]:0,tabSize:null!=Jw.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class uC extends Uw{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof uC)||this.length-(t-e)+n.length>256||8&n.flags))&&(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new uC(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Hw(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let i=e.nodeValue.length;t>i&&(t=i);let o=t,r=t,s=0;0==t&&n<0||t==i&&n>=0?cC.chrome||cC.gecko||(t?(o--,s=1):r<i&&(r++,s=-1)):n<0?o--:r<i&&r++;let a=Nw(e,o,r).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];cC.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l);return s?Pw(l,s<0):l||null}(this.dom,e,t)}}class hC extends Uw{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(Vw(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,o,r){return(!n||!(!(n instanceof hC&&n.mark.eq(this.mark))||e&&o<=0||t<this.length&&r<=0))&&(Yw(this,e,t,n?n.children.slice():[],o-1,r-1),this.markDirty(),!0)}split(e){let t=[],n=0,i=-1,o=0;for(let r of this.children){let s=n+r.length;s>e&&t.push(n<e?r.split(e-n):r),i<0&&n>=e&&(i=o),n=s,o++}let r=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new hC(this.mark,t,r)}domAtPos(e){return fC(this,e)}coordsAt(e,t){return mC(this,e,t)}}class dC extends Uw{static create(e,t,n){return new dC(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=dC.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,i,o,r){return!(n&&(!(n instanceof dC&&this.widget.compare(n.widget))||e>0&&o<=0||t<this.length&&r<=0))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof dC&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return Mb.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,i=this.posAtStart;return n?n.slice(i,i+this.length):Mb.empty}domAtPos(e){return(this.length?0==e:this.side>0)?Hw.before(this.dom):Hw.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let r=this.side?this.side<0:e>0;for(let t=r?i.length-1:0;o=i[t],!(e>0?0==t:t==i.length-1||o.top<o.bottom);t+=r?-1:1);return Pw(o,!r)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class pC extends Uw{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof pC&&e.side==this.side}split(){return new pC(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Hw.before(this.dom):Hw.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Mb.empty}get isHidden(){return!0}}function fC(e,t){let n=e.dom,{children:i}=e,o=0;for(let e=0;o<i.length;o++){let r=i[o],s=e+r.length;if(!(s==e&&r.getSide()<=0)){if(t>e&&t<s&&r.dom.parentNode==n)return r.domAtPos(t-e);if(t<=e)break;e=s}}for(let e=o;e>0;e--){let t=i[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=o;e<i.length;e++){let t=i[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new Hw(n,0)}function gC(e,t,n){let i,{children:o}=e;n>0&&t instanceof hC&&o.length&&(i=o[o.length-1])instanceof hC&&i.mark.eq(t.mark)?gC(i,t.children[0],n-1):(o.push(t),t.setParent(e)),e.length+=t.length}function mC(e,t,n){let i=null,o=-1,r=null,s=-1;!function e(t,a){for(let l=0,c=0;l<t.children.length&&c<=a;l++){let u=t.children[l],h=c+u.length;h>=a&&(u.children.length?e(u,a-c):(!r||r.isHidden&&n>0)&&(h>a||c==h&&u.getSide()>0)?(r=u,s=a-c):(c<a||c==h&&u.getSide()<0&&!u.isHidden)&&(i=u,o=a-c)),c=h}}(e,t);let a=(n<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?o:s),n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Ew(t);return n[n.length-1]||null}(e)}function vC(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}uC.prototype.children=dC.prototype.children=pC.prototype.children=Ww;const yC=Object.create(null);function xC(e,t,n){if(e==t)return!0;e||(e=yC),t||(t=yC);let i=Object.keys(e),o=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let r of i)if(r!=n&&(-1==o.indexOf(r)||e[r]!==t[r]))return!1;return!0}function bC(e,t,n){let i=!1;if(t)for(let o in t)n&&o in n||(i=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(n)for(let o in n)t&&t[o]==n[o]||(i=!0,"style"==o?e.style.cssText=n[o]:e.setAttribute(o,n[o]));return i}function _C(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}class wC{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var CC=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(CC||(CC={}));class OC extends X_{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new kC(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new SC(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,i=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:o,end:r}=RC(e,i);t=(o?i?-3e8:-1:5e8)-1,n=1+(r?i?2e8:1:-6e8)}return new SC(e,t,n,i,e.widget||null,!0)}static line(e){return new EC(e)}static set(e,t=!1){return Z_.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}OC.none=Z_.empty;class kC extends OC{constructor(e){let{start:t,end:n}=RC(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof kC&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&xC(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}kC.prototype.point=!1;class EC extends OC{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof EC&&this.spec.class==e.spec.class&&xC(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}EC.prototype.mapMode=Hb.TrackBefore,EC.prototype.point=!0;class SC extends OC{constructor(e,t,n,i,o,r){super(t,n,o,e),this.block=i,this.isReplace=r,this.mapMode=i?t<=0?Hb.TrackBefore:Hb.TrackAfter:Hb.TrackDel}get type(){return this.startSide!=this.endSide?CC.WidgetRange:this.startSide<=0?CC.WidgetBefore:CC.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof SC&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function RC(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function TC(e,t,n,i=0){let o=n.length-1;o>=0&&n[o]+i>=e?n[o]=Math.max(n[o],t):n.push(e,t)}SC.prototype.point=!0;class MC extends Uw{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,i,o,r){if(n){if(!(n instanceof MC))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),Yw(this,e,t,n?n.children.slice():[],o,r),!0}split(e){let t=new MC;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:i}=this.childPos(e);i&&(t.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let e=n;e<this.children.length;e++)t.append(this.children[e],0);for(;n>0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){xC(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){gC(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=vC(t,this.attrs||{})),n&&(this.attrs=vC({class:n},this.attrs||{}))}domAtPos(e){return fC(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(Vw(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(bC(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Uw.get(i)instanceof hC;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(n=Uw.get(i))||void 0===n?void 0:n.isEditable)||cC.ios&&this.children.some((e=>e instanceof uC))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof uC)||/[^ -~]/.test(n.text))return null;let i=Ew(n.dom);if(1!=i.length)return null;t+=i[0].width,e=i[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=mC(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight<t){let i=(t-e.textHeight)/2;return{top:n.top+i,bottom:n.bottom-i,left:n.left,right:n.left}}}return n}become(e){return e instanceof MC&&0==this.children.length&&0==e.children.length&&xC(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,i=0;n<e.children.length;n++){let o=e.children[n],r=i+o.length;if(r>=t){if(o instanceof MC)return o;if(r>t)break}i=r+o.breakAfter}return null}}class AC extends Uw{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,o,r){return!(n&&(!(n instanceof AC&&this.widget.compare(n.widget))||e>0&&o<=0||t<this.length&&r<=0))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return 0==e?Hw.before(this.dom):Hw.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new AC(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Ww}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Mb.empty}domBoundsAround(){return null}become(e){return e instanceof AC&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof PC?null:Pw(this.dom.getBoundingClientRect(),this.length?0==e:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t!=n&&(e<0?t<0:n>0)}}class PC extends wC{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class DC{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof AC&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new MC),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($C(new pC(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof AC||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append($C(new uC(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,o,r){if(this.disallowBlockEffectsFor[r]&&n instanceof SC){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=t-e;if(n instanceof SC)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new AC(n.widget||jC.block,s,n));else{let r=dC.create(n.widget||jC.inline,s,s?0:n.startSide),a=this.atCursorPos&&!r.isEditable&&o<=i.length&&(e<t||n.startSide>0),l=!r.isEditable&&(e<t||o>i.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||r.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),a&&(c.append($C(new pC(1),i),o),o=i.length+Math.max(0,o-i.length)),c.append($C(r,i),o),this.atCursorPos=l,this.pendingBuffer=l?e<t||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,n,i,o){let r=new DC(e,t,n,o);return r.openEnd=Z_.spans(i,t,n,r),r.openStart<0&&(r.openStart=r.openEnd),r.finish(r.openEnd),r}}function $C(e,t){for(let n of t)e=new hC(n,[e],e.length);return e}class jC extends wC{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}jC.inline=new jC("span"),jC.block=new jC("div");var IC=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(IC||(IC={}));const BC=IC.LTR,LC=IC.RTL;function NC(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const qC=NC("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),VC=NC("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),FC=Object.create(null),zC=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);FC[t]=n,FC[n]=-t}function QC(e){return e<=247?qC[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?VC[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const HC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class WC{get dir(){return this.level%2?LC:BC}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let o=-1;for(let r=0;r<e.length;r++){let s=e[r];if(s.from<=t&&s.to>=t){if(s.level==n)return r;(o<0||(0!=i?i<0?s.from<t:s.to>t:e[o].level>s.level))&&(o=r)}}if(o<0)throw new RangeError("Index out of range");return o}}function UC(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],o=t[n];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!UC(i.inner,o.inner))return!1}return!0}const XC=[];function KC(e,t,n,i,o,r,s){let a=i%2?2:1;if(i%2==o%2)for(let l=t,c=0;l<n;){let t=!0,u=!1;if(c==r.length||l<r[c].from){let e=XC[l];e!=a&&(t=!1,u=16==e)}let h=t||1!=a?null:[],d=t?i:i+1,p=l;e:for(;;)if(c<r.length&&p==r[c].from){if(u)break e;let f=r[c];if(!t)for(let e=f.to,t=c+1;;){if(e==n)break e;if(!(t<r.length&&r[t].from==e)){if(XC[e]==a)break e;break}e=r[t++].to}if(c++,h)h.push(f);else{f.from>l&&s.push(new WC(l,f.from,d)),GC(e,f.direction==BC!=!(d%2)?i+1:i,o,f.inner,f.from,f.to,s),l=f.to}p=f.to}else{if(p==n||(t?XC[p]!=a:XC[p]==a))break;p++}h?KC(e,l,p,i+1,o,h,s):l<p&&s.push(new WC(l,p,d)),l=p}else for(let l=n,c=r.length;l>t;){let n=!0,u=!1;if(!c||l>r[c-1].to){let e=XC[l-1];e!=a&&(n=!1,u=16==e)}let h=n||1!=a?null:[],d=n?i:i+1,p=l;e:for(;;)if(c&&p==r[c-1].to){if(u)break e;let f=r[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||r[n-1].to!=e){if(XC[e-1]==a)break e;break}e=r[--n].from}if(h)h.push(f);else{f.to<l&&s.push(new WC(f.to,l,d)),GC(e,f.direction==BC!=!(d%2)?i+1:i,o,f.inner,f.from,f.to,s),l=f.from}p=f.from}else{if(p==t||(n?XC[p-1]!=a:XC[p-1]==a))break;p--}h?KC(e,p,l,i+1,o,h,s):p<l&&s.push(new WC(p,l,d)),l=p}}function GC(e,t,n,i,o,r,s){let a=t%2?2:1;!function(e,t,n,i,o){for(let r=0;r<=i.length;r++){let s=r?i[r-1].to:t,a=r<i.length?i[r].from:n,l=r?256:o;for(let t=s,n=l,i=l;t<a;t++){let o=QC(e.charCodeAt(t));512==o?o=n:8==o&&4==i&&(o=16),XC[t]=4==o?2:o,7&o&&(i=o),n=o}for(let e=s,t=l,i=l;e<a;e++){let o=XC[e];if(128==o)e<a-1&&t==XC[e+1]&&24&t?o=XC[e]=t:XC[e]=256;else if(64==o){let o=e+1;for(;o<a&&64==XC[o];)o++;let r=e&&8==t||o<n&&8==XC[o]?1==i?1:8:256;for(let t=e;t<o;t++)XC[t]=r;e=o-1}else 8==o&&1==i&&(XC[e]=1);t=o,7&o&&(i=o)}}}(e,o,r,i,a),function(e,t,n,i,o){let r=1==o?2:1;for(let s=0,a=0,l=0;s<=i.length;s++){let c=s?i[s-1].to:t,u=s<i.length?i[s].from:n;for(let t,n,i,s=c;s<u;s++)if(n=FC[t=e.charCodeAt(s)])if(n<0){for(let e=a-3;e>=0;e-=3)if(zC[e+1]==-n){let t=zC[e+2],n=2&t?o:4&t?1&t?r:o:0;n&&(XC[s]=XC[zC[e]]=n),a=e;break}}else{if(189==zC.length)break;zC[a++]=s,zC[a++]=t,zC[a++]=l}else if(2==(i=XC[s])||1==i){let e=i==o;l=e?0:1;for(let t=a-3;t>=0;t-=3){let n=zC[t+2];if(2&n)break;if(e)zC[t+2]|=2;else{if(4&n)break;zC[t+2]|=4}}}}}(e,o,r,i,a),function(e,t,n,i){for(let o=0,r=i;o<=n.length;o++){let s=o?n[o-1].to:e,a=o<n.length?n[o].from:t;for(let l=s;l<a;){let s=XC[l];if(256==s){let s=l+1;for(;;)if(s==a){if(o==n.length)break;s=n[o++].to,a=o<n.length?n[o].from:t}else{if(256!=XC[s])break;s++}let c=1==r,u=c==(1==(s<t?XC[s]:i))?c?1:2:i;for(let t=s,i=o,r=i?n[i-1].to:e;t>l;)t==r&&(t=n[--i].from,r=i?n[i-1].to:e),XC[--t]=u;l=s}else r=s,l++}}}(o,r,i,a),KC(e,o,r,t,n,i,s)}function YC(e){return[new WC(0,e,0)]}let ZC="";function JC(e,t,n,i,o){var r;let s=i.head-e.from,a=WC.find(t,s,null!==(r=i.bidiLevel)&&void 0!==r?r:-1,i.assoc),l=t[a],c=l.side(o,n);if(s==c){let e=a+=o?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],s=l.side(!o,n),c=l.side(o,n)}let u=qb(e.text,s,l.forward(o,n));(u<l.from||u>l.to)&&(u=c),ZC=e.text.slice(Math.min(s,u),Math.max(s,u));let h=a==(o?t.length-1:0)?null:t[a+(o?1:-1)];return h&&u==c&&h.level+(o?0:1)<l.level?t_.cursor(h.side(!o,n)+e.from,h.forward(o,n)?1:-1,h.level):t_.cursor(u+e.from,l.forward(o,n)?-1:1,l.level)}function eO(e,t,n){for(let i=t;i<n;i++){let t=QC(e.charCodeAt(i));if(1==t)return BC;if(2==t||4==t)return LC}return BC}const tO=o_.define(),nO=o_.define(),iO=o_.define(),oO=o_.define(),rO=o_.define(),sO=o_.define(),aO=o_.define(),lO=o_.define(),cO=o_.define(),uO=o_.define({combine:e=>e.some((e=>e))}),hO=o_.define({combine:e=>e.some((e=>e))}),dO=o_.define();class pO{constructor(e,t="nearest",n="nearest",i=5,o=5,r=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=o,this.isSnapshot=r}map(e){return e.empty?this:new pO(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new pO(t_.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const fO=$_.define({map:(e,t)=>e.map(t)}),gO=$_.define();function mO(e,t,n){let i=e.facet(oO);i.length?i[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const vO=o_.define({combine:e=>!e.length||e[0]});let yO=0;const xO=o_.define();class bO{constructor(e,t,n,i,o){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=o(this)}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:o,decorations:r}=t||{};return new bO(yO++,e,n,i,(e=>{let t=[xO.of(e)];return r&&t.push(OO.of((t=>{let n=t.plugin(e);return n?r(n):OC.none}))),o&&t.push(o(e)),t}))}static fromClass(e,t){return bO.define((t=>new e(t)),t)}}class _O{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(mO(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){mO(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){mO(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const wO=o_.define(),CO=o_.define(),OO=o_.define(),kO=o_.define(),EO=o_.define(),SO=o_.define();function RO(e,t){let n=e.state.facet(SO);if(!n.length)return n;let i=n.map((t=>t instanceof Function?t(e):t)),o=[];return Z_.spans(i,t.from,t.to,{point(){},span(e,n,i,r){let s=e-t.from,a=n-t.from,l=o;for(let e=i.length-1;e>=0;e--,r--){let n,o=i[e].spec.bidiIsolate;if(null==o&&(o=eO(t.text,s,a)),r>0&&l.length&&(n=l[l.length-1]).to==s&&n.direction==o)n.to=a,l=n.inner;else{let e={from:s,to:a,direction:o,inner:[]};l.push(e),l=e.inner}}}}),o}const TO=o_.define();function MO(e){let t=0,n=0,i=0,o=0;for(let r of e.state.facet(TO)){let s=r(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(o=Math.max(o,s.bottom)))}return{left:t,right:n,top:i,bottom:o}}const AO=o_.define();class PO{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new PO(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,o=0,r=0,s=0;;i++){let a=i==e.length?null:e[i],l=r-s,c=a?a.fromB:1e9;for(;o<t.length&&t[o]<c;){let e=t[o],i=t[o+1],r=Math.max(s,e),a=Math.min(c,i);if(r<=a&&new PO(r+l,a+l,r,a).addToSet(n),i>c)break;o+=2}if(!a)return n;new PO(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),r=a.toA,s=a.toB}}}class DO{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ub.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let i=[];this.changes.iterChangedRanges(((e,t,n,o)=>i.push(new PO(e,t,n,o)))),this.changedRanges=i}static create(e,t,n){return new DO(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class $O extends Uw{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=OC.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new MC],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new PO(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?i=this.domChanged.newSel.head:function(e,t){let n=!1;t&&e.iterChangedRanges(((e,i)=>{e<t.to&&i>t.from&&(n=!0)}));return n}(e.changes,this.hasComposition)||e.selectionSet||(i=e.state.selection.main.head));let o=i>-1?function(e,t,n){let i=jO(e,n);if(!i)return null;let{node:o,from:r,to:s}=i,a=o.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(i.from,i.to)!=a)return null;let l=t.invertedDesc,c=new PO(l.mapPos(r),l.mapPos(s),r,s),u=[];for(let t=o.parentNode;;t=t.parentNode){let n=Uw.get(t);if(n instanceof hC)u.push({node:t,deco:n.mark});else{if(n instanceof MC||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:c,text:o,marks:u,line:t};if(t==e.contentDOM)return null;u.push({node:t,deco:new kC({inclusive:!0,attributes:_C(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:i}=this.hasComposition;n=new PO(t,i,e.changes.mapPos(t,-1),e.changes.mapPos(i,1)).addToSet(n.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(cC.ie||cC.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let r=function(e,t,n){let i=new IO;return Z_.compare(e,t,n,i),i.changes}(this.decorations,this.updateDeco(),e.changes);return n=PO.extendWithRanges(n,r),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=cC.chrome||cC.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof AC&&e.widget instanceof PC&&o.push(e.dom);i.updateGaps(o)}updateChildren(e,t,n){let i=n?n.range.addToSet(e.slice()):e,o=this.childCursor(t);for(let e=i.length-1;;e--){let t=e>=0?i[e]:null;if(!t)break;let r,s,a,l,{fromA:c,toA:u,fromB:h,toB:d}=t;if(n&&n.range.fromB<d&&n.range.toB>h){let e=DC.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=DC.build(this.view.state.doc,n.range.toB,d,this.decorations,this.dynamicDecorationMap);s=e.breakAtStart,a=e.openStart,l=t.openEnd;let i=this.compositionView(n);t.breakAtStart?i.breakAfter=1:t.content.length&&i.merge(i.length,i.length,t.content[0],!1,t.openStart,0)&&(i.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&i.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),r=e.content.concat(i).concat(t.content)}else({content:r,breakAtStart:s,openStart:a,openEnd:l}=DC.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=o.findPos(u,1),{i:g,off:m}=o.findPos(c,-1);Gw(this,g,m,p,f,r,s,a,l)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(gO)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new uC(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new hC(n,[t],t.length);let n=new MC;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=Uw.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)n=i.childPos(n.off,1),i=i.children[n.i],t(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,o=!i&&!(this.view.state.facet(vO)||this.dom.tabIndex>-1)&&kw(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||o))return;let r=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(cC.gecko&&s.empty&&!this.hasComposition&&(1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable))){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=l=new Hw(e,0),r=!0}var c;let u=this.view.observer.selectionRange;!r&&u.focusNode&&(Sw(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Sw(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,s))||(this.view.observer.ignore((()=>{cC.android&&cC.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=Cw(this.view.root);if(e)if(s.empty){if(cC.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}(a.node,a.offset);if(e&&3!=e){let t=(1==e?zw:Qw)(a.node,a.offset);t&&(a=new Hw(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=s.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();s.anchor>s.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}else;o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Hw(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Hw(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Sw(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Cw(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let r=MC.find(this,t.head);if(!r)return;let s=r.posAtStart;if(t.head==s||t.head==s+r.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(i,o)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let i=e.offset;!t&&i<n.childNodes.length;i++){let e=Uw.get(n.childNodes[i]);e instanceof MC&&(t=e.domAtPos(0))}for(let i=e.offset-1;!t&&i>=0;i--){let e=Uw.get(n.childNodes[i]);e instanceof MC&&(t=e.domAtPos(e.length))}return t?new Hw(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=Uw.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof MC)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,i=0;for(let o=this.length,r=this.children.length-1;r>=0;r--){let s=this.children[r],a=o-s.breakAfter,l=a-s.length;if(a<e)break;if(l<=e&&(l<e||s.covers(-1))&&(a>e||s.covers(1))&&(!n||s instanceof MC&&!(n instanceof MC&&t>=0)))n=s,i=l;else if(n&&l==e&&a==e&&s instanceof AC&&Math.abs(t)<2){if(s.deco.startSide<0)break;r&&(n=null)}o=l}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof MC))return null;for(;i.children.length;){let{i:e,off:t}=i.childPos(n,1);for(;;e++){if(e==i.children.length)return null;if((i=i.children[e]).length)break}n=t}if(!(i instanceof uC))return null;let o=qb(i.text,n);if(o==n)return null;let r=Nw(i.dom,n,o).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,o=this.view.contentDOM.clientWidth,r=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==IC.LTR;for(let e=0,l=0;l<this.children.length;l++){let c=this.children[l],u=e+c.length;if(u>i)break;if(e>=n){let n=c.dom.getBoundingClientRect();if(t.push(n.height),r){let t=c.dom.lastChild,i=t?Ew(t):[];if(i.length){let t=i[i.length-1],r=a?t.right-n.left:n.right-t.left;r>s&&(s=r,this.minWidth=o,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?IC.RTL:IC.LTR}measureTextSize(){for(let e of this.children)if(e instanceof MC){let t=e.measureTextSize();if(t)return t}let e,t,n,i=document.createElement("div");return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let o=Ew(i.firstChild)[0];e=i.getBoundingClientRect().height,t=o?o.width/27:7,n=o?o.height:e,i.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Kw(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let o=i==t.viewports.length?null:t.viewports[i],r=o?o.from-1:this.length;if(r>n){let i=(t.lineBlockAt(r).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(OC.replace({widget:new PC(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,r))}if(!o)break;n=o.to+1}return OC.set(e)}updateDeco(){let e=1,t=this.view.state.facet(OO).map((t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t)),n=!1,i=this.view.state.facet(kO).map(((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e}));for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(Z_.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(dO))try{if(t(this.view,e.range,e))return!0}catch(e){mO(this.view.state,e,"scroll handler")}let t,{range:n}=e,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(!i)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,t.left),top:Math.min(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)});let o=MO(this.view),r={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,i,o,r,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,h=!1;u&&!h;)if(1==u.nodeType){let e,d=u==l.body,p=1,f=1;if(d)e=Dw(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:f}=$w(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==o)t.top<e.top?(m=-(e.top-t.top+s),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+s)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+s,n<0&&t.top-m<e.top&&(m=-(e.top+m-t.top+s)));else{let i=t.bottom-t.top,r=e.bottom-e.top;m=("center"==o&&i<=r?t.top+i/2-r/2:"start"==o||"center"==o&&n<0?t.top-s:t.bottom-r+s)-e.top}if("nearest"==i?t.left<e.left?(g=-(e.left-t.left+r),n>0&&t.right>e.right+g&&(g=t.right-e.right+g+r)):t.right>e.right&&(g=t.right-e.right+r,n<0&&t.left<e.left+g&&(g=-(e.left+g-t.left+r))):g=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==a?t.left-r:t.right-(e.right-e.left)+r)-e.left,g||m)if(d)c.scrollBy(g,m);else{let e=0,n=0;if(m){let e=u.scrollTop;u.scrollTop+=m/f,n=(u.scrollTop-e)*f}if(g){let t=u.scrollLeft;u.scrollLeft+=g/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-g)<1&&(i="nearest"),n&&Math.abs(n-m)<1&&(o="nearest")}if(d)break;u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,r,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==IC.LTR)}}function jO(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=zw(n.focusNode,n.focusOffset),o=Qw(n.focusNode,n.focusOffset),r=i||o;if(o&&i&&o.node!=i.node){let t=Uw.get(o.node);if(!t||t instanceof uC&&t.text!=o.node.nodeValue)r=o;else if(e.docView.lastCompositionAfterCursor){let e=Uw.get(i.node);!e||e instanceof uC&&e.text!=i.node.nodeValue||(r=o)}}if(e.docView.lastCompositionAfterCursor=r!=i,!r)return null;let s=t-r.offset;return{from:s,to:s+r.node.nodeValue.length,node:r.node}}let IO=class{constructor(){this.changes=[]}compareRange(e,t){TC(e,t,this.changes)}comparePoint(e,t){TC(e,t,this.changes)}boundChange(e){TC(e,e,this.changes)}};function BO(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function LO(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function NO(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function qO(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function VO(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function FO(e,t,n){let i,o,r,s,a,l,c,u,h=!1;for(let d=e.firstChild;d;d=d.nextSibling){let e=Ew(d);for(let p=0;p<e.length;p++){let f=e[p];o&&NO(o,f)&&(f=qO(VO(f,o.bottom),o.top));let g=BO(t,f),m=LO(n,f);if(0==g&&0==m)return 3==d.nodeType?zO(d,t,n):FO(d,t,n);if(!i||s>m||s==m&&r>g){i=d,o=f,r=g,s=m;let a=m?n<f.top?-1:1:g?t<f.left?-1:1:0;h=!a||(a>0?p<e.length-1:p>0)}0==g?n>f.bottom&&(!c||c.bottom<f.bottom)?(a=d,c=f):n<f.top&&(!u||u.top>f.top)&&(l=d,u=f):c&&NO(c,f)?c=VO(c,f.bottom):u&&NO(u,f)&&(u=qO(u,f.top))}}if(c&&c.bottom>=n?(i=a,o=c):u&&u.top<=n&&(i=l,o=u),!i)return{node:e,offset:0};let d=Math.max(o.left,Math.min(o.right,t));return 3==i.nodeType?zO(i,d,n):h&&"false"!=i.contentEditable?FO(i,d,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,i)+(t>=(o.left+o.right)/2?1:0)}}function zO(e,t,n){let i=e.nodeValue.length,o=-1,r=1e9,s=0;for(let a=0;a<i;a++){let i=Nw(e,a,a+1).getClientRects();for(let l=0;l<i.length;l++){let c=i[l];if(c.top==c.bottom)continue;s||(s=t-c.left);let u=(c.top>n?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u<r){let n=t>=(c.left+c.right)/2,i=n;if(cC.chrome||cC.gecko){Nw(e,a).getBoundingClientRect().left==c.right&&(i=!n)}if(u<=0)return{node:e,offset:a+(i?1:0)};o=a+(i?1:0),r=u}}}return{node:e,offset:o>-1?o:s>0?e.nodeValue.length:0}}function QO(e,t,n,i=-1){var o,r;let s,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:h}=t,d=h-l;if(d<0)return 0;if(d>c)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,o=!1;s=e.elementAtHeight(d),s.type!=CC.Text;)for(;d=i>0?s.bottom+t:s.top-t,!(d>=0&&d<=c);){if(o)return n?null:0;o=!0,i=-i}h=l+d;let p=s.from;if(p<e.viewport.from)return 0==e.viewport.from?0:n?null:HO(e,a,s,u,h);if(p>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:HO(e,a,s,u,h);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,h);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,h),m&&!e.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&0!=(null===(o=e.docView.nearest(m))||void 0===o?void 0:o.isEditable)){if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,h);e&&({offsetNode:v,offset:y}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,h);t&&(({startContainer:v,startOffset:y}=t),(!e.contentDOM.contains(v)||cC.safari&&function(e,t,n){let i;if(3!=e.nodeType||t!=(i=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return Nw(e,i-1,i).getBoundingClientRect().left>n}(v,y,u)||cC.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}let i=1==e.nodeType?e.getBoundingClientRect():Nw(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-i.left>5}(v,y,u))&&(v=void 0))}v&&(y=Math.min(Aw(v),y))}if(!v||!e.docView.dom.contains(v)){let t=MC.find(e.docView,p);if(!t)return d>s.top+s.height/2?s.to:s.from;({node:v,offset:y}=FO(t.dom,u,h))}let x=e.docView.nearest(v);if(!x)return null;if(x.isWidget&&1==(null===(r=x.dom)||void 0===r?void 0:r.nodeType)){let e=x.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?x.posAtStart:x.posAtEnd}return x.localPosFromDOM(v,y)+x.posAtStart}function HO(e,t,n,i,o){let r=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;r+=Math.floor((o-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+function(e,t,n,i){for(let i=0,o=0;;){if(o>=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=qb(e,i)}return!0===i?-1:e.length}(s,r,e.state.tabSize)}function WO(e,t,n,i){let o=function(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==CC.Text))return e;return n}(e,t.head),r=i&&o.type==CC.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(r){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(o.from),s=e.posAtCoords({x:n==(i==IC.LTR)?t.right-1:t.left+1,y:(r.top+r.bottom)/2});if(null!=s)return t_.cursor(s,n?-1:1)}return t_.cursor(n?o.to:o.from,n?-1:1)}function UO(e,t,n,i){let o=e.state.doc.lineAt(t.head),r=e.bidiSpans(o),s=e.textDirectionAt(o.from);for(let a=t,l=null;;){let t=JC(o,r,s,a,n),c=ZC;if(!t){if(o.number==(n?e.state.doc.lines:1))return a;c="\n",o=e.state.doc.line(o.number+(n?1:-1)),r=e.bidiSpans(o),t=e.visualLineSide(o,!n)}if(l){if(!l(c))return a}else{if(!i)return t;l=i(c)}a=t}}function XO(e,t,n){for(;;){let i=0;for(let o of e)o.between(t-1,t+1,((e,o,r)=>{if(t>e&&t<o){let r=i||n||(t-e<o-t?-1:1);t=r<0?e:o,i=r}}));if(!i)return t}}function KO(e,t,n){let i=XO(e.state.facet(EO).map((t=>t(e))),n.from,t.head>n.from?-1:1);return i==n.from?n:t_.cursor(i,i<n.from?1:-1)}const GO="￿";class YO{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(W_.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=GO}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let r=Uw.get(i),s=Uw.get(o);(r&&s?r.breakAfter:(r?r.breakAfter:Tw(i))||Tw(o)&&("BR"!=i.nodeName||i.cmIgnore)&&this.text.length>e)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o,r=-1,s=1;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(o=i.exec(t))&&(r=o.index,s=o[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),s>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=r+s}}readNode(e){if(e.cmIgnore)return;let t=Uw.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(ZO(e,n.node,n.offset)?t:0))}}function ZO(e,t,n){for(;;){if(!t||n<Aw(t))return!1;if(t==e)return!0;n=Rw(t)+1,t=t.parentNode}}class JO{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class ek{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:r}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=o||r?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:r}=e.observer.selectionRange;n&&(t.push(new JO(n,i)),o==n&&r==i||t.push(new JO(o,r)));return t}(e),n=new YO(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?t_.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=o&&o.node==t.focusNode&&o.offset==t.focusOffset||!Ow(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=r&&r.node==t.anchorNode&&r.offset==t.anchorOffset||!Ow(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((cC.ios||cC.chrome)&&e.state.selection.main.empty&&n!=i&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,i),o=Math.max(n,i),r=s.from-t,a=s.to-o;0!=r&&1!=r&&0!=t||0!=a&&-1!=a&&o!=e.state.doc.length||(n=0,i=e.state.doc.length)}this.newSel=t_.single(i,n)}}}function tk(e,t){let n,{newSel:i}=t,o=e.state.selection.main,r=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:i,to:s}=t.bounds,a=o.from,l=null;(8===r||cC.android&&t.text.length<s-i)&&(a=o.to,l="end");let c=function(e,t,n,i){let o=Math.min(e.length,t.length),r=0;for(;r<o&&e.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==o&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if("end"==i){n-=s+Math.max(0,r-Math.min(s,a))-r}if(s<r&&e.length<t.length){r-=n<=r&&n>=s?r-n:0,a=r+(a-s),s=r}else if(a<r){r-=n<=r&&n>=a?r-n:0,s=r+(s-a),a=r}return{from:r,toA:s,toB:a}}(e.state.doc.sliceString(i,s,GO),t.text,a-i,l);c&&(cC.chrome&&13==r&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==GO+GO&&c.toB--,n={from:i+c.from,to:i+c.toA,insert:Mb.of(t.text.slice(c.from,c.toB).split(GO))})}else i&&(!e.hasFocus&&e.state.facet(vO)||i.main.eq(o))&&(i=null);if(!n&&!i)return!1;if(!n&&t.typeOver&&!o.empty&&i&&i.main.empty?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:(cC.mac||cC.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=t_.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Mb.of([n.insert.toString().replace("."," ")])}):n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,o.to))}:cC.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=t_.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:Mb.of([" "])}),n)return nk(e,n,i,r);if(i&&!i.main.eq(o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}return!1}function nk(e,t,n,i=-1){if(cC.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(cC.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&qw(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>o.head)&&qw(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&qw(e.contentDOM,"Delete",46)))return!0;let r,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>r||(r=function(e,t,n){let i,o=e.state,r=o.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=r.from<t.from?o.sliceDoc(r.from,t.from):"",s=r.to>t.to?o.sliceDoc(t.to,r.to):"";i=o.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=o.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(o.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let l,c=e.state.sliceDoc(t.from,t.to),u=n&&jO(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(r.head);let h=r.to-t.to,d=r.to-r.from;i=o.changeByRange((n=>{if(n.from==r.from&&n.to==r.to)return{changes:s,range:a||n.map(s)};let i=n.to-h,u=i-c.length;if(n.to-n.from!=d||e.state.sliceDoc(u,i)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let p=o.changes({from:u,to:i,insert:t.insert}),f=n.to-r.to;return{changes:p,range:a?t_.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(p)}}))}else i={changes:s,selection:a&&o.selection.replaceRange(a)}}let s="input.type";(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1));return o.update(i,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(sO).some((n=>n(e,t.from,t.to,s,a)))||e.dispatch(a()),!0}class ik{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,cC.safari&&e.contentDOM.addEventListener("input",(()=>null)),cC.gecko&&function(e){Mk.has(e)||(Mk.add(e),e.addEventListener("copy",(()=>{})),e.addEventListener("cut",(()=>{})))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,i=t.target;i!=e.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(n=Uw.get(i))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=rk(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let o=!t[e].handlers.length,r=n[e];r&&o!=!r.handlers.length&&(i.removeEventListener(e,this.handleEvent),r=null),r||i.addEventListener(e,this.handleEvent,{passive:o})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&lk.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),cC.android&&cC.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!cC.ios||e.synthetic||e.altKey||e.metaKey||!((t=sk.find((t=>t.keyCode==e.keyCode)))&&!e.ctrlKey||ak.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,qw(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0)))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(cC.safari&&!cC.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ok(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){mO(n.state,e)}}}function rk(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let i in e.domEventHandlers){let o=e.domEventHandlers[i];o&&n(i).handlers.push(ok(t.value,o))}if(e&&e.domEventObservers)for(let i in e.domEventObservers){let o=e.domEventObservers[i];o&&n(i).observers.push(ok(t.value,o))}}for(let e in hk)n(e).handlers.push(hk[e]);for(let e in dk)n(e).observers.push(dk[e]);return t}const sk=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ak="dthko",lk=[16,17,18,20,91,92,224,225];function ck(e){return.7*Math.max(0,e)+8}class uk{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t,n,i=e.ownerDocument;for(let o=e.parentNode;o&&!(o==i.body||t&&n);)if(1==o.nodeType)!n&&o.scrollHeight>o.clientHeight&&(n=o),!t&&o.scrollWidth>o.clientWidth&&(t=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:t,y:n}}(e.contentDOM),this.atoms=e.state.facet(EO).map((t=>t(e)));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(W_.allowMultipleSelections)&&function(e,t){let n=e.state.facet(tO);return n.length?n[0](t):cC.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=Cw(e.root);if(!i||0==i.rangeCount)return!0;let o=i.getRangeAt(0).getClientRects();for(let e=0;e<o.length;e++){let n=o[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=Ok(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,i=0,o=0,r=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:r}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let a=MO(this.view);e.clientX-a.left<=i+6?t=-ck(i-e.clientX):e.clientX+a.right>=r-6&&(t=ck(e.clientX-r)),e.clientY-a.top<=o+6?n=-ck(o-e.clientY):e.clientY+a.bottom>=s-6&&(n=ck(e.clientY-s)),this.setScrollSpeed(t,n)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let i=e.ranges[n],o=null;if(i.empty){let e=XO(this.atoms,i.from,0);e!=i.from&&(o=t_.cursor(e,-1))}else{let e=XO(this.atoms,i.from,-1),t=XO(this.atoms,i.to,1);e==i.from&&t==i.to||(o=t_.range(i.from==i.anchor?e:t,i.from==i.head?e:t))}o&&(t||(t=e.ranges.slice()),t[n]=o)}return t?t_.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some((e=>e.isUserEvent("input.type")))?this.destroy():this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const hk=Object.create(null),dk=Object.create(null),pk=cC.ie&&cC.ie_version<15||cC.ios&&cC.webkit_version<604;function fk(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function gk(e,t){t=fk(e.state,lO,t);let n,{state:i}=e,o=1,r=i.toText(t),s=r.lines==i.selection.ranges.length,a=null!=Ek&&i.selection.ranges.every((e=>e.empty))&&Ek==r.toString();if(a){let e=-1;n=i.changeByRange((n=>{let a=i.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let l=i.toText((s?r.line(o++).text:t)+i.lineBreak);return{changes:{from:a.from,insert:l},range:t_.cursor(n.from+l.length)}}))}else n=s?i.changeByRange((e=>{let t=r.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:t_.cursor(e.from+t.length)}})):i.replaceSelection(r);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function mk(e,t,n,i){if(1==i)return t_.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),o=e.doc.lineAt(t),r=t-o.from;if(0==o.length)return t_.cursor(t);0==r?n=1:r==o.length&&(n=-1);let s=r,a=r;n<0?s=qb(o.text,r,!1):a=qb(o.text,r);let l=i(o.text.slice(s,a));for(;s>0;){let e=qb(o.text,s,!1);if(i(o.text.slice(e,s))!=l)break;s=e}for(;a<o.length;){let e=qb(o.text,a);if(i(o.text.slice(a,e))!=l)break;a=e}return t_.range(s+o.from,a+o.from)}(e.state,t,n);{let n=MC.find(e.docView,t),i=e.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:i.from,r=n?n.posAtEnd:i.to;return r<e.state.doc.length&&r==i.to&&r++,t_.range(o,r)}}dk.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},hk.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),dk.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},dk.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},hk.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(iO))if(n=i(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=xk(e,t),i=Ok(t),o=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),o=o.map(e.changes))},get(t,r,s){let a,l=xk(e,t),c=mk(e,l.pos,l.bias,i);if(n.pos!=l.pos&&!r){let t=mk(e,n.pos,n.bias,i),o=Math.min(t.from,c.from),r=Math.max(t.to,c.to);c=o<c.from?t_.range(o,r):t_.range(r,o)}return r?o.replaceRange(o.main.extend(c.from,c.to)):s&&1==i&&o.ranges.length>1&&(a=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:o}=e.ranges[n];if(i<=t&&o>=t)return t_.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(o,l.pos))?a:s?o.addRange(c):t_.create([c])}}}(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new uk(e,t,n,i)),i&&e.observer.ignore((()=>{Lw(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()}));let o=e.inputState.mouseSelection;if(o)return o.start(t),!1===o.dragging}return!1};let vk=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function yk(e,t,n,i){let o=MC.find(e.docView,t);if(!o)return 1;let r=t-o.posAtStart;if(0==r)return 1;if(r==o.length)return-1;let s=o.coordsAt(r,-1);if(s&&vk(n,i,s))return-1;let a=o.coordsAt(r,1);return a&&vk(n,i,a)?1:s&&s.bottom>=i?-1:1}function xk(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:yk(e,n,t.clientX,t.clientY)}}const bk=cC.ie&&cC.ie_version<=11;let _k=null,wk=0,Ck=0;function Ok(e){if(!bk)return e.detail;let t=_k,n=Ck;return _k=e,Ck=Date.now(),wk=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(wk+1)%3:1}function kk(e,t,n,i){if(!(n=fk(e.state,lO,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=e.inputState,s=i&&r&&function(e,t){let n=e.state.facet(nO);return n.length?n[0](t):cC.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:r.from,to:r.to}:null,a={from:o,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}hk.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.nearest(t.target);if(i&&i.isWidget){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=t_.range(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",fk(e.state,cO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},hk.dragend=e=>(e.inputState.draggedContent=null,!1),hk.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),o=0,r=()=>{++o==n.length&&kk(e,t,i.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=r,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),r()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return kk(e,t,n,!0),!0}return!1},hk.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=pk?null:t.clipboardData;return n?(gk(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),gk(e,n.value)}),50)}(e),!1)};let Ek=null;hk.copy=hk.cut=(e,t)=>{let{text:n,ranges:i,linewise:o}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let o=-1;for(let{from:i}of e.selection.ranges){let r=e.doc.lineAt(i);r.number>o&&(t.push(r.text),n.push({from:r.from,to:Math.min(e.doc.length,r.to+1)})),o=r.number}i=!0}return{text:fk(e,cO,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!o)return!1;Ek=o?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=pk?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout((()=>{i.remove(),e.focus()}),50)}(e,n),!1)};const Sk=A_.define();function Rk(e,t){let n=[];for(let i of e.facet(aO)){let o=i(e,t);o&&n.push(o)}return n?e.update({effects:n,annotations:Sk.of(!0)}):null}function Tk(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Rk(e.state,t);n?e.dispatch(n):e.update([])}}),10)}dk.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Tk(e)},dk.blur=e=>{e.observer.clearSelectionRange(),Tk(e)},dk.compositionstart=dk.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},dk.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,cC.chrome&&cC.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50))},dk.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},hk.beforeinput=(e,t)=>{var n,i;if("insertReplacementText"==t.inputType&&e.observer.editContext){let i=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(i&&o.length){let t=o[0],n=e.posAtDOM(t.startContainer,t.startOffset),r=e.posAtDOM(t.endContainer,t.endOffset);return nk(e,{from:n,to:r,insert:e.state.toText(i)},null),!0}}let o;if(cC.chrome&&cC.android&&(o=sk.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return cC.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),cC.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout((()=>dk.compositionend(e,t)),20),!1};const Mk=new Set;const Ak=["pre-wrap","normal","pre-line","break-spaces"];let Pk=!1;function Dk(){Pk=!1}class $k{constructor(e){this.lineWrapping=e,this.doc=Mb.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ak.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,o,r){let s=Ak.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=o,a){this.heightSamples={};for(let e=0;e<r.length;e++){let t=r[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class jk{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Ik{constructor(e,t,n,i,o){this.from=e,this.length=t,this.top=n,this.height=i,this._content=o}get type(){return"number"==typeof this._content?CC.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof SC?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ik(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Bk=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(Bk||(Bk={}));const Lk=.001;class Nk{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Lk&&(Pk=!0),this.height=e)}replace(e,t,n){return Nk.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let o=this,r=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:u}=i[s],h=o.lineAt(a,Bk.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:o.lineAt(l,Bk.ByPosNoHeight,n,0,0);for(u+=d.to-l,l=d.to;s>0&&h.from<=i[s-1].toA;)a=i[s-1].fromA,c=i[s-1].fromB,s--,a<h.from&&(h=o.lineAt(a,Bk.ByPosNoHeight,n,0,0));c+=h.from-a,a=h.from;let p=Wk.build(n.setDoc(r),e,c,u);o=qk(o,o.replace(a,l,p))}return o.updateHeight(n,0)}static empty(){return new Fk(0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,o=0;for(;;)if(t==n)if(i>2*o){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,i-=o.size}else{if(!(o>2*i))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,o-=t.size}}else if(i<o){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(o+=t.size)}let r=0;return null==e[t-1]?(r=1,t--):null==e[t]&&(r=1,n++),new Qk(Nk.of(e.slice(0,t)),r,Nk.of(e.slice(n)))}}function qk(e,t){return e==t?e:(e.constructor!=t.constructor&&(Pk=!0),t)}Nk.prototype.size=1;class Vk extends Nk{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,i){return new Ik(i,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,i,o){return this.blockAt(0,n,i,o)}forEachLine(e,t,n,i,o,r){e<=o+this.length&&t>=o&&r(this.blockAt(0,n,i,o))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Fk extends Vk{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new Ik(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof Fk||i instanceof zk&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof zk?i=new Fk(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Nk.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class zk extends Nk{constructor(e){super(e,0)}heightMetrics(e,t){let n,i=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,r=o-i+1,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);n=t/r,this.length>r+1&&(s=(this.height-t)/(this.length-r-1))}else n=this.height/r;return{firstLine:i,lastLine:o,perLine:n,perChar:s}}blockAt(e,t,n,i){let{firstLine:o,lastLine:r,perLine:s,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let o=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),r=t.doc.lineAt(o),l=s+r.length*a,c=Math.max(n,e-l/2);return new Ik(r.from,r.length,c,l,0)}{let i=Math.max(0,Math.min(r-o,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(o+i);return new Ik(a,l,n+s*i,s,0)}}lineAt(e,t,n,i,o){if(t==Bk.ByHeight)return this.blockAt(e,n,i,o);if(t==Bk.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new Ik(t,i-t,0,0,0)}let{firstLine:r,perLine:s,perChar:a}=this.heightMetrics(n,o),l=n.doc.lineAt(e),c=s+l.length*a,u=l.number-r,h=i+s*u+a*(l.from-o-u);return new Ik(l.from,l.length,Math.max(i,Math.min(h,i+this.height-c)),c,0)}forEachLine(e,t,n,i,o,r){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,o);for(let c=e,u=i;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-s;u+=a*n+l*(e-o-n)}let i=a+l*t.length;r(new Ik(t.from,t.length,u,i,0)),u+=i,c=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof zk?n[n.length-1]=new zk(e.length+i):n.push(null,new zk(i-1))}if(e>0){let t=n[0];t instanceof zk?n[0]=new zk(e+t.length):n.unshift(new zk(e-1),null)}return Nk.of(n)}decomposeLeft(e,t){t.push(new zk(e-1),null)}decomposeRight(e,t){t.push(null,new zk(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let o=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],r=Math.max(t,i.from),s=-1;for(i.from>t&&n.push(new zk(i.from-t-1).updateHeight(e,t));r<=o&&i.more;){let t=e.doc.lineAt(r).length;n.length&&n.push(null);let o=i.heights[i.index++];-1==s?s=o:Math.abs(o-s)>=Lk&&(s=-2);let a=new Fk(t,o);a.outdated=!1,n.push(a),r+=t+1}r<=o&&n.push(null,new zk(o-r).updateHeight(e,r));let a=Nk.of(n);return(s<0||Math.abs(a.height-this.height)>=Lk||Math.abs(s-this.heightMetrics(e,t).perLine)>=Lk)&&(Pk=!0),qk(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Qk extends Nk{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let o=n+this.left.height;return e<o?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,o,i+this.left.length+this.break)}lineAt(e,t,n,i,o){let r=i+this.left.height,s=o+this.left.length+this.break,a=t==Bk.ByHeight?e<r:e<s,l=a?this.left.lineAt(e,t,n,i,o):this.right.lineAt(e,t,n,r,s);if(this.break||(a?l.to<s:l.from>s))return l;let c=t==Bk.ByPosNoHeight?Bk.ByPosNoHeight:Bk.ByPos;return a?l.join(this.right.lineAt(s,c,n,r,s)):this.left.lineAt(s,c,n,i,o).join(l)}forEachLine(e,t,n,i,o,r){let s=i+this.left.height,a=o+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,i,o,r),t>=a&&this.right.forEachLine(e,t,n,s,a,r);else{let l=this.lineAt(a,Bk.ByPos,n,i,o);e<l.from&&this.left.forEachLine(e,l.from-1,n,i,o,r),l.to>=e&&l.from<=t&&r(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,r)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let o=[];e>0&&this.decomposeLeft(e,o);let r=o.length;for(let e of n)o.push(e);if(e>0&&Hk(o,r-1),t<this.length){let e=o.length;this.decomposeRight(t,o),Hk(o,e)}return Nk.of(o)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Nk.of(this.break?[e,null,t]:[e,t]):(this.left=qk(this.left,e),this.right=qk(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:o,right:r}=this,s=t+o.length+this.break,a=null;return i&&i.from<=t+o.length&&i.more?a=o=o.updateHeight(e,t,n,i):o.updateHeight(e,t,n),i&&i.from<=s+r.length&&i.more?a=r=r.updateHeight(e,s,n,i):r.updateHeight(e,s,n),a?this.balanced(o,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Hk(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof zk&&(i=e[t+1])instanceof zk&&e.splice(t-1,3,new zk(n.length+1+i.length))}class Wk{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Fk?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Fk(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,o=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let r=t-e;n.block?this.addBlock(new Vk(r,i,n)):(r||o||i>=5)&&this.addLineDeco(i,o,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Fk(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new zk(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Fk)return e;let t=new Fk(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Fk||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Fk(0,-1));let n=e;for(let e of this.nodes)e instanceof Fk&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let o=new Wk(n,e);return Z_.spans(t,n,i,o,0),o.finish(n)}}class Uk{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&TC(e,t,this.changes,5)}}function Xk(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,o=i.defaultView||window,r=Math.max(0,n.left),s=Math.min(o.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(o.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();r=Math.max(r,i.left),s=Math.min(s,i.right),a=Math.max(a,i.top),l=Math.min(t==e.parentNode?o.innerHeight:l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:r-n.left,right:Math.max(r,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function Kk(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Gk{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],o=t[n];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,t){return OC.replace({widget:new Yk(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class Yk extends wC{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Zk{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=nE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=IC.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(CO).some((e=>"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new $k(t),this.stateDeco=e.facet(OO).filter((e=>"function"!=typeof e)),this.heightMap=Nk.empty().applyChanges(this.stateDeco,Mb.empty,this.heightOracle.setDoc(e.doc),[new PO(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=OC.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>i>=e&&i<=t))){let{from:t,to:n}=this.lineBlockAt(i);e.push(new Jk(t,n))}}return this.viewports=e.sort(((e,t)=>e.from-t.from)),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?nE:new iE(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(oE(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(OO).filter((e=>"function"!=typeof e));let i=e.changedRanges,o=PO.extendWithRanges(i,function(e,t,n){let i=new Uk;return Z_.compare(e,t,n,i,0),i.changes}(n,this.stateDeco,e?e.changes:Ub.empty(this.state.doc.length))),r=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Dk(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=r||Pk)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(l||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(hO)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?IC.RTL:IC.LTR;let r=this.heightOracle.mustRefreshForWrapping(o),s=t.getBoundingClientRect(),a=r||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let l=0,c=0;if(s.width&&s.height){let{scaleX:e,scaleY:n}=$w(t,s);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,l|=16,r=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,h=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==h||(this.paddingTop=u,this.paddingBottom=h,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Fw(e.scrollDOM);let p=(this.printing?Kk:Xk)(t,this.paddingTop),f=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}(e.dom))return 0;let v=s.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(t)&&(r=!0),r||i.lineWrapping&&Math.abs(v-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:s,textHeight:a}=e.docView.measureTextSize();r=n>0&&i.refresh(o,n,s,a,v/s,t),r&&(e.docView.minWidth=0,l|=16)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),Dk();for(let n of this.viewports){let o=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(r?Nk.empty().applyChanges(this.stateDeco,Mb.empty,this.heightOracle,[new PO(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,r,new jk(n.from,o))}Pk&&(l|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:r,visibleBottom:s}=this,a=new Jk(i.lineAt(r-1e3*n,Bk.ByHeight,o,0,0).from,i.lineAt(s+1e3*(1-n),Bk.ByHeight,o,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=i.lineAt(e,Bk.ByPos,o,0,0);n="center"==t.y?(s.top+s.bottom)/2-r/2:"start"==t.y||"nearest"==t.y&&e<a.from?s.top:s.bottom-r,a=new Jk(i.lineAt(n-500,Bk.ByHeight,o,0,0).from,i.lineAt(n+r+500,Bk.ByHeight,o,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Jk(this.heightMap.lineAt(n,Bk.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Bk.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Bk.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,Bk.ByPos,this.heightOracle,0,0),{visibleTop:r,visibleBottom:s}=this;return(0==e||i<=r-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||o>=s+Math.max(10,Math.min(n,250)))&&i>r-2e3&&o<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new Gk(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,o=i>>1,r=i<<1;if(this.defaultTextDirection!=IC.LTR&&!n)return[];let s=[],a=(i,r,l,c)=>{if(r-i<o)return;let u=this.state.selection.main,h=[u.from];u.empty||h.push(u.to);for(let e of h)if(e>i&&e<r)return a(i,e-10,l,c),void a(e+10,r,l,c);let d=function(e,t){for(let n of e)if(t(n))return n;return}(e,(e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-i)<o&&Math.abs(e.to-r)<o&&!h.some((t=>e.from<t&&e.to>t))));if(!d){if(r<l.to&&t&&n&&t.visibleRanges.some((e=>e.from<=r&&e.to>=r))){let e=t.moveToLineBoundary(t_.cursor(r),!1,!0).head;e>i&&(r=e)}let e=this.gapSize(l,i,r,c);d=new Gk(i,r,e,n||e<2e6?e:2e6)}s.push(d)},l=t=>{if(t.length<r||t.type!=CC.Text)return;let o=function(e,t,n){let i=[],o=e,r=0;Z_.spans(n,e,t,{span(){},point(e,t){e>o&&(i.push({from:o,to:e}),r+=e-o),o=t}},20),o<t&&(i.push({from:o,to:t}),r+=t-o);return{total:r,ranges:i}}(t.from,t.to,this.stateDeco);if(o.total<r)return;let s,l,c=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,r=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let i=tE(o,c),s=((this.visibleBottom-this.visibleTop)/2+r)/t.height;e=i-s,n=i+s}else e=(this.visibleTop-t.top-r)/t.height,n=(this.visibleBottom-t.top+r)/t.height;s=eE(o,e),l=eE(o,n)}else{let n=o.total*this.heightOracle.charWidth,r=i*this.heightOracle.charWidth,a=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=n.size-n.displaySize);let u,h,d=this.pixelViewport.left+a,p=this.pixelViewport.right+a;if(null!=c){let e=tE(o,c),t=((p-d)/2+r)/n;u=e-t,h=e+t}else u=(d-r)/n,h=(p+r)/n;s=eE(o,u),l=eE(o,h)}s>t.from&&a(t.from,s,t,o),l<t.to&&a(l,t.to,t,o)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,i){let o=tE(i,n)-tE(i,t);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){Gk.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=OC.set(e.map((e=>e.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];Z_.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let o=this.visibleRanges[t],r=n[t];o.from==r.from&&o.to==r.to||(i|=4,e&&e.mapPos(o.from,-1)==r.from&&e.mapPos(o.to,1)==r.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||oE(this.heightMap.lineAt(e,Bk.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((t=>t.top<=e&&t.bottom>=e))||oE(this.heightMap.lineAt(this.scaler.fromDOM(e),Bk.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return oE(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Jk{constructor(e,t){this.from=e,this.to=t}}function eE({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:o}=t[e],r=o-n;if(i<=r)return n+i;i-=r}}function tE(e,t){let n=0;for(let{from:i,to:o}of e.ranges){if(t<=o){n+=t-i;break}n+=o-i}return n/e.total}const nE={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class iE{constructor(e,t,n){let i=0,o=0,r=0;this.viewports=n.map((({from:n,to:o})=>{let r=t.lineAt(n,Bk.ByPos,e,0,0).top,s=t.lineAt(o,Bk.ByPos,e,0,0).bottom;return i+=s-r,{from:n,to:o,top:r,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(t.height-i);for(let e of this.viewports)e.domTop=r+(e.top-o)*this.scale,r=e.domBottom=e.domTop+(e.bottom-e.top),o=e.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return i+(e-n)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);n=o.bottom,i=o.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return n+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);n=o.bottom,i=o.domBottom}}eq(e){return e instanceof iE&&(this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every(((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)))}}function oE(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Ik(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map((e=>oE(e,t))):e._content)}const rE=o_.define({combine:e=>e.join(" ")}),sE=o_.define({combine:e=>e.indexOf(!0)>-1}),aE=fw.newName(),lE=fw.newName(),cE=fw.newName(),uE={"&light":"."+lE,"&dark":"."+cE};function hE(e,t,n){return new fw(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const dE=hE("."+aE,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},uE),pE={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},fE=cC.ie&&cC.ie_version<=11;class gE{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new jw,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(cC.ie&&cC.ie_version<=11||cC.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===e.constructor.EDIT_CONTEXT||cC.chrome&&cC.chrome_version<126||(this.editContext=new yE(e),e.state.facet(vO)&&(e.contentDOM.editContext=this.editContext.editContext)),fE&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()})),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(vO)?n.root.activeElement!=this.dom:!kw(this.dom,i))return;let o=i.anchorNode&&n.docView.nearest(i.anchorNode);o&&o.ignoreEvent(e)?t||(this.selectionChanged=!1):(cC.ie&&cC.ie_version<=11||cC.android&&cC.chrome)&&!n.state.selection.main.empty&&i.focusNode&&Sw(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Cw(e.root);if(!t)return!1;let n=cC.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return vE(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?vE(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=kw(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,Aw(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:(n=e,i=Aw(n))}else{if(n==e)return!0;i=Rw(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,pE),fE&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),fE&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;if(e){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&qw(this.dom,e.key,e.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame((()=>{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let o of e){let e=this.readMutation(o);e&&(e.typeOver&&(i=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&kw(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new ek(this.view,e,t,n);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=tk(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=mE(t,e.previousSibling||e.target.previousSibling,-1),i=mE(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(vO)!=e.state.facet(vO)&&(e.view.contentDOM.editContext=e.state.facet(vO)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function mE(e,t,n){for(;t;){let i=Uw.get(t);if(i&&i.parent==e)return i;let o=t.parentNode;t=o!=e.dom?o:n>0?t.nextSibling:t.previousSibling}return null}function vE(e,t){let n=t.startContainer,i=t.startOffset,o=t.endContainer,r=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return Sw(s.node,s.offset,o,r)&&([n,i,o,r]=[o,r,n,i]),{anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:r}}class yE{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let n=e.state.selection.main,{anchor:i,head:o}=n,r=this.toEditorPos(t.updateRangeStart),s=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:r,drifted:!1});let a={from:r,to:s,insert:Mb.of(t.text.split("\n"))};if(a.from==this.from&&i<this.from?a.from=i:a.to==this.to&&i>this.to&&(a.to=i),a.from!=a.to||a.insert.length){if((cC.mac||cC.android)&&a.from==o-1&&/^\. ?$/.test(t.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(a={from:r,to:s,insert:Mb.of([t.text.replace("."," ")])}),this.pendingContextChange=a,!e.state.readOnly){let n=this.to-this.from+(a.to-a.from+a.insert.length);nk(e,a,t_.single(this.toEditorPos(t.selectionStart,n),this.toEditorPos(t.selectionEnd,n)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))}else{let i=t_.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));i.main.eq(n)||e.dispatch({selection:i,userEvent:"select"})}},this.handlers.characterboundsupdate=n=>{let i=[],o=null;for(let t=this.toEditorPos(n.rangeStart),r=this.toEditorPos(n.rangeEnd);t<r;t++){let n=e.coordsForChar(t);o=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||o||new DOMRect,i.push(o)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if("None"!=t&&"None"!=i){let o=this.toEditorPos(e.rangeStart),r=this.toEditorPos(e.rangeEnd);if(o<r){let e=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==i?1:2}px`;n.push(OC.mark({attributes:{style:e}}).range(o,r))}}}e.dispatch({effects:gO.of(OC.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=Cw(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges(((o,r,s,a,l)=>{if(n)return;let c=l.length-(r-o);if(i&&r>=i.to){if(i.from==o&&i.to==r&&i.insert.eq(l))return i=this.pendingContextChange=null,t+=c,void(this.to+=c);i=null,this.revertPending(e.state)}if(o+=t,(r+=t)<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||r>this.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(r),l.toString()),this.to+=c}t+=c})),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange;this.composing&&(this.composing.drifted||e.transactions.some((e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to))))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==i||this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class xE{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach((e=>n(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Zk(e.state||W_.create(e)),e.scrollTo&&e.scrollTo.is(fO)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(xO).map((e=>new _O(e)));for(let e of this.plugins)e.update(this);this.observer=new gE(this),this.inputState=new ik(this),this.inputState.ensureHandlers(this.plugins),this.docView=new $O(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...e){let t=1==e.length&&e[0]instanceof j_?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,i=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);let r=this.hasFocus,s=0,a=null;e.some((e=>e.annotation(Sk)))?(this.inputState.notifiedFocused=r,s=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,a=Rk(o,r),a||(s=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(W_.phrases)!=this.state.facet(W_.phrases))return this.setState(o);t=DO.create(this,o,e),t.flags|=s;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new pO(e.empty?e:t_.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(fO)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=wE.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(AO)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(rE)!=t.state.facet(rE)&&(this.viewState.mustMeasureContent=!0),(n||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(rO))try{e(t)}catch(e){mO(this.state,e,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!tk(this,c)&&l.force&&qw(this.contentDOM,l.key,l.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Zk(e),this.plugins=e.facet(xO).map((e=>new _O(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new $O(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xO),n=e.state.facet(xO);if(t!=n){let i=[];for(let o of n){let n=t.indexOf(o);if(n<0)i.push(new _O(o));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){mO(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:r}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(r<0)if(Fw(n))o=-1,r=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);o=e.from,r=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((e=>{try{return e.read(this)}catch(e){return mO(this.state,e),_E}})),c=DO.create(this,this.state,[]),u=!1;c.flags|=s,t?t.flags|=s:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=_E)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){mO(this.state,e)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,r=-1;continue}{let e=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-r;if(e>1||e<-1){i+=e,n.scrollTop=i/this.scaleY,r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(rO))e(t)}get themeClasses(){return aE+" "+(this.state.facet(sE)?cE:lE)+" "+this.state.facet(rE)}updateAttrs(){let e=CE(this,wO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(vO)?"true":"false",class:"cm-content",style:`${cC.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),CE(this,CO,t);let n=this.observer.ignore((()=>{let n=bC(this.contentDOM,this.contentAttrs,t),i=bC(this.dom,this.editorAttrs,e);return n||i}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)if(e.is(xE.announce)){t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value}}mountStyles(){this.styleModules=this.state.facet(AO);let e=this.state.facet(xE.cspNonce);fw.mount(this.root,this.styleModules.concat(dE).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find((t=>t.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return KO(this,e,UO(this,e,t,n))}moveByGroup(e,t){return KO(this,e,UO(this,e,t,(t=>function(e,t,n){let i=e.state.charCategorizer(t),o=i(n);return e=>{let t=i(e);return o==F_.Space&&(o=t),o==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=n[t?n.length-1:0];return t_.cursor(o.side(t,i)+e.from,o.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return WO(this,e,t,n)}moveVertically(e,t,n){return KO(this,e,function(e,t,n,i){let o=t.head,r=n?1:-1;if(o==(n?e.state.doc.length:0))return t_.cursor(o,t.assoc);let s,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(o,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-l.left),s=r<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(o);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(o-t.from))),s=(r<0?t.top:t.bottom)+u}let h=l.left+a,d=null!=i?i:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(d+t)*r,i=QO(e,{x:h,y:n},!1,r);if(n<l.top||n>l.bottom||(r<0?i<o:i>o)){let t=e.docView.coordsForChar(i),o=!t||n<t.top?-1:1;return t_.cursor(i,o,void 0,a)}}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),QO(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i);return Pw(n,o[WC.find(o,e-i.from,-1,t)].dir==IC.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(uO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>bE)return YC(e.length);let t,n=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||UC(i.isolates,t=RO(this,e))))return i.order;t||(t=RO(this,e));let i=function(e,t,n){if(!e)return[new WC(0,0,t==LC?1:0)];if(t==BC&&!n.length&&!HC.test(e))return YC(e.length);if(n.length)for(;e.length>XC.length;)XC[XC.length]=256;let i=[],o=t==BC?0:1;return GC(e,o,o,n,0,e.length,i),i}(e.text,n,t);return this.bidiCache.push(new wE(e.from,e.to,n,t,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||cC.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{Lw(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return fO.of(new pO("number"==typeof e?t_.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return fO.of(new pO(t_.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return bO.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return bO.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=fw.newName(),i=[rE.of(n),AO.of(hE(`.${n}`,e))];return t&&t.dark&&i.push(sE.of(!0)),i}static baseTheme(e){return v_.lowest(AO.of(hE("."+aE,e,uE)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&Uw.get(n)||Uw.get(e);return(null===(t=null==i?void 0:i.rootView)||void 0===t?void 0:t.view)||null}}xE.styleModule=AO,xE.inputHandler=sO,xE.clipboardInputFilter=lO,xE.clipboardOutputFilter=cO,xE.scrollHandler=dO,xE.focusChangeEffect=aO,xE.perLineTextDirection=uO,xE.exceptionSink=oO,xE.updateListener=rO,xE.editable=vO,xE.mouseSelectionStyle=iO,xE.dragMovesSelection=nO,xE.clickAddsSelectionRange=tO,xE.decorations=OO,xE.outerDecorations=kO,xE.atomicRanges=EO,xE.bidiIsolatedRanges=SO,xE.scrollMargins=TO,xE.darkTheme=sE,xE.cspNonce=o_.define({combine:e=>e.length?e[0]:""}),xE.contentAttributes=CO,xE.editorAttributes=wO,xE.lineWrapping=xE.contentAttributes.of({class:"cm-lineWrapping"}),xE.announce=$_.define();const bE=4096,_E={};class wE{constructor(e,t,n,i,o,r){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=o,this.order=r}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],i=e.length?e[e.length-1].dir:IC.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let r=e[o];r.dir!=i||t.touchesRange(r.from,r.to)||n.push(new wE(t.mapPos(r.from,1),t.mapPos(r.to,-1),r.dir,r.isolates,!1,r.order))}return n}}function CE(e,t,n){for(let i=e.state.facet(t),o=i.length-1;o>=0;o--){let t=i[o],r="function"==typeof t?t(e):t;r&&vC(r,n)}return n}const OE=cC.mac?"mac":cC.windows?"win":cC.linux?"linux":"key";function kE(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const EE=v_.default(xE.domEventHandlers({keydown:(e,t)=>function(e,t,n,i){AE=t;let o=function(e){var t=!(xw&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||bw&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?yw:vw)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),r=Vb(o,0),s=zb(r)==o.length&&" "!=o,a="",l=!1,c=!1,u=!1;TE&&TE.view==n&&TE.scope==i&&(a=TE.prefix+" ",lk.indexOf(t.keyCode)<0&&(c=!0,TE=null));let h,d,p=new Set,f=e=>{if(e){for(let t of e.run)if(!p.has(t)&&(p.add(t),t(n)))return e.stopPropagation&&(u=!0),!0;e.preventDefault&&(e.stopPropagation&&(u=!0),c=!0)}return!1},g=e[i];g&&(f(g[a+kE(o,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(cC.windows&&t.ctrlKey&&t.altKey)&&(h=vw[t.keyCode])&&h!=o?(f(g[a+kE(h,t,!0)])||t.shiftKey&&(d=yw[t.keyCode])!=o&&d!=h&&f(g[a+kE(d,t,!1)]))&&(l=!0):s&&t.shiftKey&&f(g[a+kE(o,t,!0)])&&(l=!0),!l&&f(g._any)&&(l=!0));c&&(l=!0);l&&u&&t.stopPropagation();return AE=null,l}(function(e){let t=e.facet(SE),n=RE.get(t);n||RE.set(t,n=function(e,t=OE){let n=Object.create(null),i=Object.create(null),o=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},r=(e,i,r,s,a)=>{var l,c;let u=n[e]||(n[e]=Object.create(null)),h=i.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let i,o,r,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e<n.length-1;++e){const a=n[e];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))r=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?s=!0:o=!0}}return i&&(a="Alt-"+a),o&&(a="Ctrl-"+a),s&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(e,t)));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");o(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=TE={view:t,prefix:n,scope:e};return setTimeout((()=>{TE==i&&(TE=null)}),ME),!0}]})}let d=h.join(" ");o(d,!1);let p=u[d]||(u[d]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=u._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});r&&p.run.push(r),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:o}=i;for(let t in e)e[t].run.push((e=>o(e,AE)))}let o=i[t]||i.key;if(o)for(let t of e)r(t,o,i.run,i.preventDefault,i.stopPropagation),i.shift&&r(t,"Shift-"+o,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[])));return n}(t.state),e,t,"editor")})),SE=o_.define({enables:EE}),RE=new WeakMap;let TE=null;const ME=4e3;let AE=null;const PE={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};!(cC.ios&&cC.webkit&&cC.webkit_version<534)&&(PE[".cm-line"].caretColor=PE[".cm-content"].caretColor="transparent !important");class DE extends wC{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Ew(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=Pw(t[0],"rtl"!=n.direction),o=parseInt(n.lineHeight);return i.bottom-i.top>1.5*o?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function $E(e){return bO.fromClass(class{constructor(t){this.view=t,this.placeholder=e?OC.set([OC.widget({widget:new DE(e),side:1}).range(0)]):OC.none}get decorations(){return this.view.state.doc.length?OC.none:this.placeholder}},{decorations:e=>e.decorations})}const jE="-10000px";class IE{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e));let o=null;this.tooltipViews=this.tooltips.map((e=>o=n(e,o)))}update(e,t){var n;let i=e.state.facet(this.facet),o=i.filter((e=>e));if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let r=[],s=t?[]:null;for(let n=0;n<o.length;n++){let i=o[n],a=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(a=e)}if(a<0)r[n]=this.createTooltipView(i,n?r[n-1]:null),s&&(s[n]=!!i.above);else{let i=r[n]=this.tooltipViews[a];s&&(s[n]=t[a]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)r.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(s.forEach(((e,n)=>t[n]=e)),t.length=s.length),this.input=i,this.tooltips=o,this.tooltipViews=r,!0}}function BE(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const LE=o_.define({combine:e=>{var t,n,i;return{position:cC.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=e.find((e=>e.tooltipSpace)))||void 0===i?void 0:i.tooltipSpace)||BE}}}),NE=new WeakMap,qE=bO.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(LE);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new IE(e,QE,((e,t)=>this.createTooltip(e,t)),(e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()})),this.above=this.manager.tooltips.map((e=>!!e.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(LE);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=jE,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(cC.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==jE&&"0px"==e.style.left){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),o=MO(this.view);return{visible:{left:i.left+o.left,top:i.top+o.top,right:i.right-o.right,bottom:i.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(LE).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:n,space:i,scaleX:o,scaleY:r}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,h=e.pos[a],d=e.size[a];if(!h||!1!==l.clip&&(h.bottom<=Math.max(n.top,i.top)||h.top>=Math.min(n.bottom,i.bottom)||h.right<Math.max(n.left,i.left)-.1||h.left>Math.min(n.right,i.right)+.1)){u.style.top=jE;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,g=d.right-d.left,m=null!==(t=NE.get(c))&&void 0!==t?t:d.bottom-d.top,v=c.offset||zE,y=this.view.textDirection==IC.LTR,x=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(h.left-(p?14:0)+v.x,i.right-g)):Math.min(Math.max(i.left,h.left-g+(p?14:0)-v.x),i.right-g),b=this.above[a];!l.strictSide&&(b?h.top-m-f-v.y<i.top:h.bottom+m+f+v.y>i.bottom)&&b==i.bottom-h.bottom>h.top-i.top&&(b=this.above[a]=!b);let _=(b?h.top-i.top:i.bottom-h.bottom)-f;if(_<m&&!1!==c.resize){if(_<this.view.defaultLineHeight){u.style.top=jE;continue}NE.set(c,m),u.style.height=(m=_)/r+"px"}else u.style.height&&(u.style.height="");let w=b?h.top-m-f-v.y:h.bottom+f+v.y,C=x+g;if(!0!==c.overlap)for(let e of s)e.left<C&&e.right>x&&e.top<w+m&&e.bottom>w&&(w=b?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(w-e.parent.top)/r+"px",VE(u,(x-e.parent.left)/o)):(u.style.top=w/r+"px",VE(u,x/o)),p){let e=h.left+(y?v.x:-v.x)-(x+14-7);p.style.left=e/o+"px"}!0!==c.overlap&&s.push({left:x,top:w,right:C,bottom:w+m}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=jE}},{eventObservers:{scroll(){this.maybeMeasure()}}});function VE(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const FE=xE.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zE={x:0,y:0},QE=o_.define({enables:[qE,FE]}),HE=o_.define({combine:e=>e.reduce(((e,t)=>e.concat(t)),[])});class WE{static create(e){return new WE(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new IE(e,HE,((e,t)=>this.createHostedView(e,t)),(e=>e.dom.remove()))}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i)if(void 0===t)t=i;else if(t!==i)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const UE=QE.compute([HE],(e=>{let t=e.facet(HE);return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:WE.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class XE{constructor(e,t,n,i,o){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let i,o=1;if(n instanceof dC)i=n.posAtStart;else{if(i=e.posAtCoords(t),null==i)return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let r=e.bidiSpans(e.state.doc.lineAt(i)).find((e=>e.from<=i&&e.to>=i)),s=r&&r.dir==IC.RTL?-1:1;o=t.x<n.left?-s:s}let r=this.source(e,i,o);if(null==r?void 0:r.then){let t=this.pending={pos:i};r.then((n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))}),(t=>mO(e.state,t,"hover tooltip")))}else!r||Array.isArray(r)&&!r.length||e.dispatch({effects:this.setHover.of(Array.isArray(r)?r:[r])})}get tooltip(){let e=this.view.plugin(qE),t=e?e.manager.tooltips.findIndex((e=>e.create==WE.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!function(e,t){let n,{left:i,right:o,top:r,bottom:s}=e.getBoundingClientRect();if(n=e.querySelector(".cm-tooltip-arrow")){let e=n.getBoundingClientRect();r=Math.min(e.top,r),s=Math.max(e.bottom,s)}return t.clientX>=i-KE&&t.clientX<=o+KE&&t.clientY>=r-KE&&t.clientY<=s+KE}(o.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,r=null!==(n=null===(t=i[0])||void 0===t?void 0:t.end)&&void 0!==n?n:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,i,o,r){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>i||s.right<i||s.top>o||Math.min(s.bottom,a)<o)return!1;let l=e.posAtCoords({x:i,y:o},!1);return l>=t&&l<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const KE=4;function GE(e,t={}){let n=$_.define(),i=h_.define({create:()=>[],update(e,i){if(e.length&&(t.hideOnChange&&(i.docChanged||i.selection)?e=[]:t.hideOn&&(e=e.filter((e=>!t.hideOn(i,e)))),i.docChanged)){let t=[];for(let n of e){let e=i.changes.mapPos(n.pos,-1,Hb.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),n);o.pos=e,null!=o.end&&(o.end=i.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of i.effects)t.is(n)&&(e=t.value),t.is(ZE)&&(e=[]);return e},provide:e=>HE.from(e)});return{active:i,extension:[i,bO.define((o=>new XE(o,e,i,n,t.hoverTime||300))),UE]}}function YE(e,t){let n=e.plugin(qE);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const ZE=$_.define(),JE=o_.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}}),eS=bO.fromClass(class{constructor(e){this.input=e.state.facet(iS),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(JE);this.top=new tS(e,!0,t.topContainer),this.bottom=new tS(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(JE);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new tS(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new tS(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(iS);if(n!=this.input){let t=n.filter((e=>e)),i=[],o=[],r=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),i.push(t),(t.top?o:r).push(t)}this.specs=t,this.panels=i,this.top.sync(o),this.bottom.sync(r);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>xE.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class tS{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=nS(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=nS(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function nS(e){let t=e.nextSibling;return e.remove(),t}const iS=o_.define({enables:eS});class oS extends X_{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}oS.prototype.elementClass="",oS.prototype.toDOM=void 0,oS.prototype.mapMode=Hb.TrackBefore,oS.prototype.startSide=oS.prototype.endSide=-1,oS.prototype.point=!0;const rS=1024;let sS=0;class aS{constructor(e,t){this.from=e,this.to=t}}class lS{constructor(e={}){this.id=sS++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=hS.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}lS.closedBy=new lS({deserialize:e=>e.split(" ")}),lS.openedBy=new lS({deserialize:e=>e.split(" ")}),lS.group=new lS({deserialize:e=>e.split(" ")}),lS.isolate=new lS({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),lS.contextHash=new lS({perNode:!0}),lS.lookAhead=new lS({perNode:!0}),lS.mounted=new lS({perNode:!0});class cS{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[lS.mounted.id]}}const uS=Object.create(null);class hS{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):uS,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new hS(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(lS.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(lS.group),i=-1;i<(n?n.length:0);i++){let o=t[i<0?e.name:n[i]];if(o)return o}}}}hS.none=new hS("",Object.create(null),0,8);class dS{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);e&&(i||(i=Object.assign({},n.props)),i[e[0].id]=e[1])}t.push(i?new hS(n.name,i,n.id,n.flags):n)}return new dS(t)}}const pS=new WeakMap,fS=new WeakMap;var gS;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"}(gS||(gS={}));class mS{constructor(e,t,n,i,o){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[e,t]of o)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=cS.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new TS(this.topNode,e)}cursorAt(e,t=0,n=0){let i=pS.get(this)||this.topNode,o=new TS(i);return o.moveTo(e,t),pS.set(this,o._tree),o}get topNode(){return new wS(this,0,0,null)}resolve(e,t=0){let n=bS(pS.get(this)||this.topNode,e,t,!1);return pS.set(this,n),n}resolveInner(e,t=0){let n=bS(fS.get(this)||this.topNode,e,t,!0);return fS.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),o=null;for(let e=i instanceof wS?i:i.context.parent;e;e=e.parent)if(e.index<0){let r=e.parent;(o||(o=[i])).push(r.resolve(t,n)),e=r}else{let r=cS.get(e.tree);if(r&&r.overlay&&r.overlay[0].from<=t&&r.overlay[r.overlay.length-1].to>=t){let s=new wS(r.tree,r.overlay[0].from+e.from,-1,e);(o||(o=[i])).push(bS(s,t,n,!1))}}return o?SS(o):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:o=this.length}=e,r=e.mode||0,s=(r&gS.IncludeAnonymous)>0;for(let e=this.cursor(r|gS.IncludeAnonymous);;){let r=!1;if(e.from<=o&&e.to>=i&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;r=!0}for(;r&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;r=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:DS(hS.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new mS(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new mS(hS.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:o=rS,reused:r=[],minRepeatType:s=i.types.length}=e,a=Array.isArray(n)?new vS(n,n.length):n,l=i.types,c=0,u=0;function h(e,t,n,y,x,b){let{id:_,start:w,end:C,size:O}=a,k=u,E=c;for(;O<0;){if(a.next(),-1==O){let t=r[_];return n.push(t),void y.push(w-e)}if(-3==O)return void(c=_);if(-4==O)return void(u=_);throw new RangeError(`Unrecognized record size: ${O}`)}let S,R,T=l[_],M=w-e;if(C-w<=o&&(R=m(a.pos-t,x))){let t=new Uint16Array(R.size-R.skip),n=a.pos-R.size,o=t.length;for(;a.pos>n;)o=v(R.start,t,o);S=new yS(t,C-R.start,i),M=R.start-e}else{let e=a.pos-O;a.next();let t=[],n=[],i=_>=s?_:-1,r=0,l=C;for(;a.pos>e;)i>=0&&a.id==i&&a.size>=0?(a.end<=l-o&&(f(t,n,w,r,a.end,l,i,k,E),r=t.length,l=a.end),a.next()):b>2500?d(w,e,t,n):h(w,e,t,n,i,b+1);if(i>=0&&r>0&&r<t.length&&f(t,n,w,r,w,l,i,k,E),t.reverse(),n.reverse(),i>-1&&r>0){let e=p(T,E);S=DS(T,t,n,0,t.length,0,C-w,e,e)}else S=g(T,t,n,C-w,k-C,E)}n.push(S),y.push(M)}function d(e,t,n,r){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:i}=a;if(i>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=n-o),s.push(e,t,n),l++,a.next()}}if(l){let t=new Uint16Array(4*l),o=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-o,t[n++]=s[e+2]-o,t[n++]=n;n.push(new yS(t,s[2]-o,i)),r.push(o-e)}}function p(e,t){return(n,i,o)=>{let r,s,a=0,l=n.length-1;if(l>=0&&(r=n[l])instanceof mS){if(!l&&r.type==e&&r.length==o)return r;(s=r.prop(lS.lookAhead))&&(a=i[l]+r.length+s)}return g(e,n,i,o,a,t)}}function f(e,t,n,o,r,s,a,l,c){let u=[],h=[];for(;e.length>o;)u.push(e.pop()),h.push(t.pop()+n-r);e.push(g(i.types[a],u,h,s-r,l-s,c)),t.push(r-n)}function g(e,t,n,i,o,r,s){if(r){let e=[lS.contextHash,r];s=s?[e].concat(s):[e]}if(o>25){let e=[lS.lookAhead,o];s=s?[e].concat(s):[e]}return new mS(e,t,n,i,s)}function m(e,t){let n=a.fork(),i=0,r=0,l=0,c=n.end-o,u={size:0,start:0,skip:0};e:for(let o=n.pos-e;n.pos>o;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=r,u.skip=l,l+=4,i+=4,n.next();continue}let a=n.pos-e;if(e<0||a<o||n.start<c)break;let h=n.id>=s?4:0,d=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;h+=4}else n.id>=s&&(h+=4);n.next()}r=d,i+=e,l+=h}return(t<0||i==e)&&(u.size=i,u.start=r,u.skip=l),u.size>4?u:void 0}function v(e,t,n){let{id:i,start:o,end:r,size:l}=a;if(a.next(),l>=0&&i<s){let s=n;if(l>4){let i=a.pos-(l-4);for(;a.pos>i;)n=v(e,t,n)}t[--n]=s,t[--n]=r-e,t[--n]=o-e,t[--n]=i}else-3==l?c=i:-4==l&&(u=i);return n}let y=[],x=[];for(;a.pos>0;)h(e.start||0,e.bufferStart||0,y,x,-1,0);let b=null!==(t=e.length)&&void 0!==t?t:y.length?x[0]+y[0].length:0;return new mS(l[e.topID],y.reverse(),x.reverse(),b)}(e)}}mS.empty=new mS(hS.none,[],[],0);class vS{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new vS(this.buffer,this.index)}}class yS{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return hS.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),n==(e+=4))return o;let r=[];for(;e<n;)r.push(this.childString(e)),e=this.buffer[e+3];return o+"("+r.join(",")+")"}findChild(e,t,n,i,o){let{buffer:r}=this,s=-1;for(let a=e;a!=t&&!(xS(o,i,r[a+1],r[a+2])&&(s=a,n>0));a=r[a+3]);return s}slice(e,t,n){let i=this.buffer,o=new Uint16Array(t-e),r=0;for(let s=e,a=0;s<t;){o[a++]=i[s++],o[a++]=i[s++]-n;let t=o[a++]=i[s++]-n;o[a++]=i[s++]-e,r=Math.max(r,t)}return new yS(o,r,this.set)}}function xS(e,t,n,i){switch(e){case-2:return n<t;case-1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function bS(e,t,n,i){for(var o;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof wS&&e.index<0?null:e.parent;if(!t)return e;e=t}let r=i?0:gS.IgnoreOverlays;if(i)for(let i=e,s=i.parent;s;i=s,s=i.parent)i instanceof wS&&i.index<0&&(null===(o=s.enter(t,n,r))||void 0===o?void 0:o.from)!=i.from&&(e=s);for(;;){let i=e.enter(t,n,r);if(!i)return e;e=i}}class _S{cursor(e=0){return new TS(this,e)}getChild(e,t=null,n=null){let i=CS(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return CS(this,e,t,n)}resolve(e,t=0){return bS(this,e,t,!1)}resolveInner(e,t=0){return bS(this,e,t,!0)}matchContext(e){return OS(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class wS extends _S{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,o=0){for(let r=this;;){for(let{children:s,positions:a}=r._tree,l=t>0?s.length:-1;e!=l;e+=t){let l=s[e],c=a[e]+r.from;if(xS(i,n,c,c+l.length))if(l instanceof yS){if(o&gS.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,t,n-c,i);if(s>-1)return new ES(new kS(r,l,e,c),null,s)}else if(o&gS.IncludeAnonymous||!l.type.isAnonymous||MS(l)){let s;if(!(o&gS.IgnoreMounts)&&(s=cS.get(l))&&!s.overlay)return new wS(s.tree,c,e,r);let a=new wS(l,c,e,r);return o&gS.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,n,i)}}if(o&gS.IncludeAnonymous||!r.type.isAnonymous)return null;if(e=r.index>=0?r.index+t:t<0?-1:r._parent._tree.children.length,r=r._parent,!r)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&gS.IgnoreOverlays)&&(i=cS.get(this._tree))&&i.overlay){let n=e-this.from;for(let{from:e,to:o}of i.overlay)if((t>0?e<=n:e<n)&&(t<0?o>=n:o>n))return new wS(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function CS(e,t,n,i){let o=e.cursor(),r=[];if(!o.firstChild())return r;if(null!=n)for(let e=!1;!e;)if(e=o.type.is(n),!o.nextSibling())return r;for(;;){if(null!=i&&o.type.is(i))return r;if(o.type.is(t)&&r.push(o.node),!o.nextSibling())return null==i?r:[]}}function OS(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class kS{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class ES extends _S{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return o<0?null:new ES(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&gS.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new ES(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ES(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ES(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,o=n.buffer[this.index+3];if(o>i){let r=n.buffer[this.index+1];e.push(n.slice(i,o,r)),t.push(0)}return new mS(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function SS(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let o=e[i];(o.from>n.from||o.to<n.to)&&(n=o,t=i)}let i=n instanceof wS&&n.index<0?null:n.parent,o=e.slice();return i?o[t]=i:o.splice(t,1),new RS(o,n)}class RS{constructor(e,t){this.heads=e,this.node=t}get next(){return SS(this.heads)}}class TS{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof wS)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof wS?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&gS.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&gS.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&gS.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let i=t+e,o=e<0?-1:n._tree.children.length;i!=o;i+=e){let e=n._tree.children[i];if(this.mode&gS.IncludeAnonymous||e instanceof yS||!e.type.isAnonymous||MS(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let r=e;r;r=r._parent)if(r.index==i){if(i==this.index)return r;t=r,n=o+1;break e}i=this.stack[--o]}for(let e=n;e<this.stack.length;e++)t=new ES(this.buffer,t,this.stack[e]);return this.bufferNode=new ES(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return OS(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return OS(this._tree,e,i);let r=n[t.buffer[this.stack[o]]];if(!r.isAnonymous){if(e[i]&&e[i]!=r.name)return!1;i--}}return!0}}function MS(e){return e.children.some((e=>e instanceof yS||!e.type.isAnonymous||MS(e)))}const AS=new WeakMap;function PS(e,t){if(!e.isAnonymous||t instanceof yS||t.type!=e)return 1;let n=AS.get(t);if(null==n){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof mS)){n=1;break}n+=PS(e,i)}AS.set(t,n)}return n}function DS(e,t,n,i,o,r,s,a,l){let c=0;for(let n=i;n<o;n++)c+=PS(e,t[n]);let u=Math.ceil(1.5*c/8),h=[],d=[];return function t(n,i,o,s,a){for(let c=o;c<s;){let o=c,p=i[c],f=PS(e,n[c]);for(c++;c<s;c++){let t=PS(e,n[c]);if(f+t>=u)break;f+=t}if(c==o+1){if(f>u){let e=n[o];t(e.children,e.positions,0,e.children.length,i[o]+a);continue}h.push(n[o])}else{let t=i[c-1]+n[c-1].length-p;h.push(DS(e,n,i,o,c,p,t,null,l))}d.push(p+a-r)}}(t,n,i,o,0),(a||l)(h,d,s)}class $S{constructor(e,t,n,i,o=!1,r=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(o?1:0)|(r?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new $S(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],o=1,r=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s<t.length?t[s]:null,u=c?c.fromA:1e9;if(u-a>=n)for(;r&&r.from<u;){let t=r;if(a>=t.from||u<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,u)-l;t=e>=n?null:new $S(e,n,t.tree,t.offset+l,s>0,!!c)}if(t&&i.push(t),r.to>u)break;r=o<e.length?e[o++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return i}}class jS{startParse(e,t,n){return"string"==typeof e&&(e=new IS(e)),n=n?n.length?n.map((e=>new aS(e.from,e.to))):[new aS(0,0)]:[new aS(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class IS{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new lS({perNode:!0});let BS=0;class LS{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=BS++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n="string"==typeof e?e:"?";if(e instanceof LS&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let i=new LS(n,[],null,[]);if(i.set.push(i),t)for(let e of t.set)i.set.push(e);return i}static defineModifier(e){let t=new qS(e);return e=>e.modified.indexOf(t)>-1?e:qS.get(e.base||e,e.modified.concat(t).sort(((e,t)=>e.id-t.id)))}}let NS=0;class qS{constructor(e){this.name=e,this.instances=[],this.id=NS++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>n.base==e&&function(e,t){return e.length==t.length&&e.every(((e,n)=>e==t[n]))}(t,n.modified)));if(n)return n;let i=[],o=new LS(e.name,i,e,t);for(let e of t)e.instances.push(o);let r=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,o=t.length;i<o;i++)t.push(t[i].concat(e[n]));return t.sort(((e,t)=>t.length-e.length))}(t);for(let t of e.set)if(!t.modified.length)for(let e of r)i.push(qS.get(t,e));return o}}function VS(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let e of n.split(" "))if(e){let n=[],o=2,r=e;for(let t=0;;){if("..."==r&&t>0&&t+3==e.length){o=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!i)throw new RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),t+=i[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){o=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);r=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new zS(i,o,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return FS.add(t)}const FS=new lS;class zS{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function QS(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:o=null}=t||{};return{style:e=>{let t=o;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function HS(e,t,n,i=0,o=e.length){let r=new WS(i,Array.isArray(t)?t:[t],n);r.highlightRange(e.cursor(),i,o,"",r.highlighters),r.flush(o)}zS.empty=new zS([],2,null);class WS{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,o){let{type:r,from:s,to:a}=e;if(s>=n||a<=t)return;r.isTop&&(o=this.highlighters.filter((e=>!e.scope||e.scope(r))));let l=i,c=function(e){let t=e.type.prop(FS);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||zS.empty,u=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(o,c.tags);if(u&&(l&&(l+=" "),l+=u,1==c.mode&&(i+=(i?" ":"")+u)),this.startSpan(Math.max(t,s),l),c.opaque)return;let h=e.tree&&e.tree.prop(lS.mounted);if(h&&h.overlay){let r=e.node.enter(h.overlay[0].from+s,1),c=this.highlighters.filter((e=>!e.scope||e.scope(h.tree.type))),u=e.firstChild();for(let d=0,p=s;;d++){let f=d<h.overlay.length?h.overlay[d]:null,g=f?f.from+s:a,m=Math.max(t,p),v=Math.min(n,g);if(m<v&&u)for(;e.from<v&&(this.highlightRange(e,m,v,i,o),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!f||g>n)break;p=f.to+s,p>t&&(this.highlightRange(r.cursor(),Math.max(t,f.from+s),Math.min(n,p),"",c),this.startSpan(Math.min(n,p),l))}u&&e.parent()}else if(e.firstChild()){h&&(i="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,o),this.startSpan(Math.min(n,e.to),l)}}while(e.nextSibling());e.parent()}}}const US=LS.define,XS=US(),KS=US(),GS=US(KS),YS=US(KS),ZS=US(),JS=US(ZS),eR=US(ZS),tR=US(),nR=US(tR),iR=US(),oR=US(),rR=US(),sR=US(rR),aR=US(),lR={comment:XS,lineComment:US(XS),blockComment:US(XS),docComment:US(XS),name:KS,variableName:US(KS),typeName:GS,tagName:US(GS),propertyName:YS,attributeName:US(YS),className:US(KS),labelName:US(KS),namespace:US(KS),macroName:US(KS),literal:ZS,string:JS,docString:US(JS),character:US(JS),attributeValue:US(JS),number:eR,integer:US(eR),float:US(eR),bool:US(ZS),regexp:US(ZS),escape:US(ZS),color:US(ZS),url:US(ZS),keyword:iR,self:US(iR),null:US(iR),atom:US(iR),unit:US(iR),modifier:US(iR),operatorKeyword:US(iR),controlKeyword:US(iR),definitionKeyword:US(iR),moduleKeyword:US(iR),operator:oR,derefOperator:US(oR),arithmeticOperator:US(oR),logicOperator:US(oR),bitwiseOperator:US(oR),compareOperator:US(oR),updateOperator:US(oR),definitionOperator:US(oR),typeOperator:US(oR),controlOperator:US(oR),punctuation:rR,separator:US(rR),bracket:sR,angleBracket:US(sR),squareBracket:US(sR),paren:US(sR),brace:US(sR),content:tR,heading:nR,heading1:US(nR),heading2:US(nR),heading3:US(nR),heading4:US(nR),heading5:US(nR),heading6:US(nR),contentSeparator:US(tR),list:US(tR),quote:US(tR),emphasis:US(tR),strong:US(tR),link:US(tR),monospace:US(tR),strikethrough:US(tR),inserted:US(),deleted:US(),changed:US(),invalid:US(),meta:aR,documentMeta:US(aR),annotation:US(aR),processingInstruction:US(aR),definition:LS.defineModifier("definition"),constant:LS.defineModifier("constant"),function:LS.defineModifier("function"),standard:LS.defineModifier("standard"),local:LS.defineModifier("local"),special:LS.defineModifier("special")};for(let e in lR){let t=lR[e];t instanceof LS&&(t.name=e)}var cR;QS([{tag:lR.link,class:"tok-link"},{tag:lR.heading,class:"tok-heading"},{tag:lR.emphasis,class:"tok-emphasis"},{tag:lR.strong,class:"tok-strong"},{tag:lR.keyword,class:"tok-keyword"},{tag:lR.atom,class:"tok-atom"},{tag:lR.bool,class:"tok-bool"},{tag:lR.url,class:"tok-url"},{tag:lR.labelName,class:"tok-labelName"},{tag:lR.inserted,class:"tok-inserted"},{tag:lR.deleted,class:"tok-deleted"},{tag:lR.literal,class:"tok-literal"},{tag:lR.string,class:"tok-string"},{tag:lR.number,class:"tok-number"},{tag:[lR.regexp,lR.escape,lR.special(lR.string)],class:"tok-string2"},{tag:lR.variableName,class:"tok-variableName"},{tag:lR.local(lR.variableName),class:"tok-variableName tok-local"},{tag:lR.definition(lR.variableName),class:"tok-variableName tok-definition"},{tag:lR.special(lR.variableName),class:"tok-variableName2"},{tag:lR.definition(lR.propertyName),class:"tok-propertyName tok-definition"},{tag:lR.typeName,class:"tok-typeName"},{tag:lR.namespace,class:"tok-namespace"},{tag:lR.className,class:"tok-className"},{tag:lR.macroName,class:"tok-macroName"},{tag:lR.propertyName,class:"tok-propertyName"},{tag:lR.operator,class:"tok-operator"},{tag:lR.comment,class:"tok-comment"},{tag:lR.meta,class:"tok-meta"},{tag:lR.invalid,class:"tok-invalid"},{tag:lR.punctuation,class:"tok-punctuation"}]);const uR=new lS;const hR=new lS;class dR{constructor(e,t,n=[],i=""){this.data=e,this.name=i,W_.prototype.hasOwnProperty("tree")||Object.defineProperty(W_.prototype,"tree",{get(){return gR(this)}}),this.parser=t,this.extension=[OR.of(this),W_.languageData.of(((e,t,n)=>{let i=pR(e,t,n),o=i.type.prop(uR);if(!o)return[];let r=e.facet(o),s=i.type.prop(hR);if(s){let o=i.resolve(t-i.from,n);for(let t of s)if(t.test(o,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(r)}}return r}))].concat(n)}isActiveAt(e,t,n=-1){return pR(e,t,n).type.prop(uR)==this.data}findRegions(e){let t=e.facet(OR);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(uR)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(lS.mounted);if(o){if(o.tree.prop(uR)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(i(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let o=e.children[n];o instanceof mS&&i(o,e.positions[n]+t)}};return i(gR(e),0),n}get allowsNesting(){return!0}}function pR(e,t,n){let i=e.facet(OR),o=gR(e).topNode;if(!i||i.allowsNesting)for(let e=o;e;e=e.enter(t,n,gS.ExcludeBuffers))e.type.isTop&&(o=e);return o}dR.setState=$_.define();class fR extends dR{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,o_.define({combine:n?e=>e.concat(n):void 0}));var n;return new fR(t,e.parser.configure({props:[uR.add((e=>e.isTop?t:void 0))]}),e.name)}configure(e,t){return new fR(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function gR(e){let t=e.field(dR.state,!1);return t?t.tree:mS.empty}class mR{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let vR=null;class yR{constructor(e,t,n=[],i,o,r,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=o,this.viewport=r,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new yR(e,t,[],mS.empty,0,n,[],null)}startParse(){return this.parser.startParse(new mR(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=mS.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped($S.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}}))}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped($S.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=vR;vR=this;try{return e()}finally{vR=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=xR(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:o,viewport:r,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,i,o)=>t.push({fromA:e,toA:n,fromB:i,toB:o}))),n=$S.applyChanges(n,t),i=mS.empty,o=0,r={from:e.mapPos(r.from,-1),to:e.mapPos(r.to,1)},this.skipped.length){s=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&s.push({from:n,to:i})}}}return new yR(this.parser,t,n,i,o,r,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=xR(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends jS{createParse(t,n,i){let o=i[0].from,r=i[i.length-1].to,s={parsedPos:o,advance(){let t=vR;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=r,new mS(hS.none,[],[],r-o)},stoppedAt:null,stopAt(){}};return s}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return vR}}function xR(e,t,n){return $S.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class bR{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new bR(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=yR.create(e.facet(OR).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new bR(n)}}dR.state=h_.define({create:bR.init,update(e,t){for(let e of t.effects)if(e.is(dR.setState))return e.value;return t.startState.facet(OR)!=t.state.facet(OR)?bR.init(t.state):e.apply(t)}});let _R=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(_R=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const wR="undefined"!=typeof navigator&&(null===(cR=navigator.scheduling)||void 0===cR?void 0:cR.isInputPending)?()=>navigator.scheduling.isInputPending():null,CR=bO.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(dR.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(dR.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=_R(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,o=n.field(dR.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let r=Date.now()+Math.min(this.chunkBudget,100,e&&!wR?Math.max(25,e.timeRemaining()-5):1e9),s=o.context.treeLen<i&&n.doc.length>i+1e3,a=o.context.work((()=>wR&&wR()||Date.now()>r),i+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:dR.setState.of(new bR(o.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>mO(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),OR=o_.define({combine:e=>e.length?e[0]:null,enables:e=>[dR.state,CR,xE.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class kR{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const ER=o_.define(),SR=o_.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function RR(e){let t=e.facet(SR);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function TR(e,t){let n="",i=e.tabSize,o=e.facet(SR)[0];if("\t"==o){for(;t>=i;)n+="\t",t-=i;o=" "}for(let e=0;e<t;e++)n+=o;return n}function MR(e,t){e instanceof W_&&(e=new AR(e));for(let n of e.state.facet(ER)){let i=n(e,t);if(void 0!==i)return i}let n=gR(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),o=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(o!=i.node){let e=[];for(let t=o;t&&(t.from!=i.node.from||t.type!=i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return DR(i,e,n)}(e,n,t):null}class AR{constructor(e,t={}){this.state=e,this.options=t,this.unit=RR(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return null!=i&&i>=n.from&&i<=n.to?o&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),o=this.countColumn(n,e-i),r=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return r>-1&&(o+=r-this.countColumn(n,n.search(/\S|$/))),o}countColumn(e,t=e.length){return uw(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let e=o(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const PR=new lS;function DR(e,t,n){for(let i=e;i;i=i.next){let e=$R(i.node);if(e)return e(IR.create(t,n,i))}return 0}function $R(e){let t=e.type.prop(PR);if(t)return t;let n,i=e.firstChild;if(i&&(n=i.type.prop(lS.closedBy))){let t=e.lastChild,i=t&&n.indexOf(t.name)>-1;return e=>NR(e,!0,1,void 0,i&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?jR:null}function jR(){return 0}class IR extends AR{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new IR(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(BR(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return DR(this.context.next,this.base,this.pos)}}function BR(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function LR({closing:e,align:t=!0,units:n=1}){return i=>NR(i,t,n,e)}function NR(e,t,n,i,o){let r=e.textAfter,s=r.match(/^\s*/)[0].length,a=i&&r.slice(s,s+i.length)==i||o==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let o=e.options.simulateBreak,r=e.state.doc.lineAt(n.from),s=null==o||o<=r.from?r.to:Math.min(r.to,o);for(let e=n.to;;){let o=t.childAfter(e);if(!o||o==i)return null;if(!o.type.isSkipped){if(o.from>=s)return null;let e=/^ */.exec(r.text.slice(n.to-r.from))[0].length;return{from:n.from,to:n.to+e}}e=o.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function qR({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const VR=200;const FR=new lS;function zR(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}class QR{constructor(e,t){let n;function i(e){let t=fw.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const o="string"==typeof t.all?t.all:t.all?i(t.all):void 0,r=t.scope;this.scope=r instanceof dR?e=>e.prop(uR)==r.data:r?e=>e==r:void 0,this.style=QS(e.map((e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))}))),{all:o}).style,this.module=n?new fw(n):null,this.themeType=t.themeType}static define(e,t){return new QR(e,t||{})}}const HR=o_.define(),WR=o_.define({combine:e=>e.length?[e[0]]:null});function UR(e){let t=e.facet(HR);return t.length?t:e.facet(WR)}class XR{constructor(e){this.markCache=Object.create(null),this.tree=gR(e.state),this.decorations=this.buildDeco(e,UR(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=gR(e.state),n=UR(e.state),i=n!=UR(e.startState),{viewport:o}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!i&&t.type==this.tree.type&&r>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return OC.none;let n=new J_;for(let{from:i,to:o}of e.visibleRanges)HS(this.tree,t,((e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=OC.mark({class:i})))}),i,o);return n.finish()}}const KR=v_.high(bO.fromClass(XR,{decorations:e=>e.decorations}));lR.meta,lR.link,lR.heading,lR.emphasis,lR.strong,lR.strikethrough,lR.keyword,lR.atom,lR.bool,lR.url,lR.contentSeparator,lR.labelName,lR.literal,lR.inserted,lR.string,lR.deleted,lR.regexp,lR.escape,lR.string,lR.variableName,lR.variableName,lR.typeName,lR.namespace,lR.className,lR.variableName,lR.macroName,lR.propertyName,lR.comment,lR.invalid;const GR=xE.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),YR=1e4,ZR="()[]{}",JR=o_.define({combine:e=>U_(e,{afterCursor:!0,brackets:ZR,maxScanDistance:YR,renderMatch:nT})}),eT=OC.mark({class:"cm-matchingBracket"}),tT=OC.mark({class:"cm-nonmatchingBracket"});function nT(e){let t=[],n=e.matched?eT:tT;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const iT=h_.define({create:()=>OC.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(JR);for(let e of t.state.selection.ranges){if(!e.empty)continue;let o=cT(t.state,e.head,-1,i)||e.head>0&&cT(t.state,e.head-1,1,i)||i.afterCursor&&(cT(t.state,e.head,1,i)||e.head<t.state.doc.length&&cT(t.state,e.head+1,-1,i));o&&(n=n.concat(i.renderMatch(o,t.state)))}return OC.set(n,!0)},provide:e=>xE.decorations.from(e)}),oT=[iT,GR];function rT(e={}){return[JR.of(e),oT]}const sT=new lS;function aT(e,t,n){let i=e.prop(t<0?lS.openedBy:lS.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function lT(e){let t=e.type.prop(sT);return t?t(e.node):e}function cT(e,t,n,i={}){let o=i.maxScanDistance||YR,r=i.brackets||ZR,s=gR(e),a=s.resolveInner(t,n);for(let i=a;i;i=i.parent){let o=aT(i.type,n,r);if(o&&i.from<i.to){let s=lT(i);if(s&&(n>0?t>=s.from&&t<s.to:t>s.from&&t<=s.to))return uT(e,t,n,i,s,o,r)}}return function(e,t,n,i,o,r,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!u.next().done&&e<=r;){let r=u.value;n<0&&(e+=r.length);let a=t+e*n;for(let e=n>0?0:r.length-1,t=n>0?r.length:-1;e!=t;e+=n){let t=s.indexOf(r[e]);if(!(t<0||i.resolveInner(a+e,1).type!=o))if(t%2==0==n>0)h++;else{if(1==h)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=r.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,o,r)}function uT(e,t,n,i,o,r,s){let a=i.parent,l={from:o.from,to:o.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do{if(n<0?u.to<=i.from:u.from>=i.to){if(0==c&&r.indexOf(u.type.name)>-1&&u.from<u.to){let e=lT(u);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(aT(u.type,n,s))c++;else if(aT(u.type,-n,s)){if(0==c){let e=lT(u);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}const hT=Object.create(null),dT=[hS.none],pT=[],fT=Object.create(null),gT=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])gT[e]=vT(hT,t);function mT(e,t){pT.indexOf(e)>-1||(pT.push(e),console.warn(t))}function vT(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||lR[n];i?"function"==typeof i?t.length?t=t.map(i):mT(n,`Modifier ${n} used at start of tag`):t.length?mT(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:mT(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),o=i+" "+n.map((e=>e.id)),r=fT[o];if(r)return r.id;let s=fT[o]=hS.define({id:dT.length,name:i,props:[VS({[i]:n})]});return dT.push(s),s.id}IC.RTL,IC.LTR;class yT{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=gR(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),o=i.search(CT(e,!1));return o<0?null:{from:n+o,to:this.pos,text:i.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function xT(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function bT(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,i]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=xT(t)+xT(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(t);return e=>{let o=e.matchBefore(i);return o||e.explicit?{from:o?o.from:e.pos,options:t,validFor:n}:null}}class _T{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function wT(e){return e.selection.main.from}function CT(e,t){var n;let{source:i}=e,o=t&&"^"!=i[0],r="$"!=i[i.length-1];return o||r?new RegExp(`${o?"^":""}(?:${i})${r?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const OT=A_.define();const kT=new WeakMap;function ET(e){if(!Array.isArray(e))return e;let t=kT.get(e);return t||kT.set(e,t=bT(e)),t}const ST=$_.define(),RT=$_.define();class TT{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Vb(e,t),i=zb(n);this.chars.push(n);let o=e.slice(t,t+i),r=o.toUpperCase();this.folded.push(Vb(r==o?o.toLowerCase():r,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:o,byWord:r}=this;if(1==t.length){let i=Vb(e,0),o=zb(i),r=o==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;r+=-200}return this.ret(r,[0,o])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let o=0,r=Math.min(e.length,200);o<r&&l<a;){let r=Vb(e,o);r!=t[l]&&r!=n[l]||(i[l++]=o),o+=zb(r)}if(l<a)return null}let c=0,u=0,h=!1,d=0,p=-1,f=-1,g=/[a-z]/.test(e),m=!0;for(let i=0,l=Math.min(e.length,200),v=0;i<l&&u<a;){let l=Vb(e,i);s<0&&(c<a&&l==t[c]&&(o[c++]=i),d<a&&(l==t[d]||l==n[d]?(0==d&&(p=i),f=i+1,d++):d=0));let y,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=Fb(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!i||1==x&&g||0==v&&0!=x)&&(t[u]==l||n[u]==l&&(h=!0)?r[u++]=i:r.length&&(m=!1)),v=x,i+=zb(l)}return u==a&&0==r[0]&&m?this.result((h?-200:0)-100,r,e):d==a&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):d==a?this.ret(-900-e.length,[p,f]):u==a?this.result((h?-200:0)-100-700+(m?0:-1100),r,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[],o=0;for(let e of t){let t=e+(this.astral?zb(Vb(n,e)):1);o&&i[o-1]==e?i[o-1]=t:(i[o++]=e,i[o++]=t)}return this.ret(e-n.length,i)}}class MT{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const AT=o_.define({combine:e=>U_(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:DT,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>PT(e(n),t(n)),optionClass:(e,t)=>n=>PT(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function PT(e,t){return e?t?e+" "+t:e:t}function DT(e,t,n,i,o,r){let s,a,l=e.textDirection==IC.RTL,c=l,u=!1,h="top",d=t.left-o.left,p=o.right-t.right,f=i.right-i.left,g=i.bottom-i.top;if(c&&d<Math.min(f,p)?c=!1:!c&&p<Math.min(f,d)&&(c=!0),f<=(c?d:p))s=Math.max(o.top,Math.min(n.top,o.bottom-g))-t.top,a=Math.min(400,c?d:p);else{u=!0,a=Math.min(400,(l?t.right:o.right-t.left)-30);let e=o.bottom-t.bottom;e>=g||e>t.top?s=n.bottom-t.top:(h="bottom",s=t.bottom-n.top)}return{style:`${h}: ${s/((t.bottom-t.top)/r.offsetHeight)}px; max-width: ${a/((t.right-t.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}function $T(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}class jT{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:r}=i.open,s=e.state.facet(AT);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let o=document.createElement("span");o.className="cm-completionLabel";let r=e.displayLabel||e.label,s=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>s&&o.appendChild(document.createTextNode(r.slice(s,t)));let a=o.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(r.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<r.length&&o.appendChild(document.createTextNode(r.slice(s))),o},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort(((e,t)=>e.position-t.position)).map((e=>e.render))}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=$T(o.length,r,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:i}=e.state.field(t).open;for(let t,o=n.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(t=/-(\d+)$/.exec(o.id))&&+t[1]<i.length)return this.applyCompletion(e,i[+t[1]]),void n.preventDefault()})),this.dom.addEventListener("focusout",(t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(AT).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:RT.of(null)})})),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:o,selected:r,disabled:s}=n.open;i.open&&i.open.options==o||(this.range=$T(o.length,r,e.state.facet(AT).maxRenderedOptions),this.showOptions(o,n.id)),this.updateSel(),s!=(null===(t=i.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=$T(t.options.length,t.selected,this.view.state.facet(AT).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let o="string"==typeof i?document.createTextNode(i):i(n);if(!o)return;"then"in o?o.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>mO(this.view.state,e,"completion info"))):this.addInfoPane(o,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)"LI"==n.nodeName&&n.id?i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):i--;return t&&function(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),o=n.height/e.offsetHeight;i.top<n.top?e.scrollTop-=(n.top-i.top)/o:i.bottom>n.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/o)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let e=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(AT).positionInfo(this.view,t,i,n,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let r=n.from;r<n.to;r++){let{completion:s,match:a}=e[r],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;if(e!=o&&(r>n.from||0==n.from))if(o=e,"string"!=typeof l&&l.header)i.appendChild(l.header(l));else{i.appendChild(document.createElement("completion-section")).textContent=e}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+r,c.setAttribute("role","option");let u=this.optionClass(s);u&&(c.className=u);for(let e of this.optionContent){let t=e(s,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function IT(e,t){return n=>new jT(n,e,t)}function BT(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class LT{constructor(e,t,n,i,o,r){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=o,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new LT(this.options,FT(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,o,r){if(i&&!r&&e.some((e=>e.isPending)))return i.setDisabled();let s=function(e,t){let n=[],i=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some((t=>t.name==e))||i.push("string"==typeof t?{name:e}:t)}},r=t.facet(AT);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)o(new _T(t,i.source,e?e(t):[],1e9-n.length));else{let n,s=t.sliceDoc(i.from,i.to),a=r.filterStrict?new MT(s):new TT(s);for(let t of i.result.options)if(n=a.match(t.label)){let r=t.displayLabel?e?e(t,n.matched):[]:n.matched;o(new _T(t,i.source,r,n.score+(t.boost||0)))}}}if(i){let e=Object.create(null),t=0,o=(e,t)=>{var n,i;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(i=t.rank)&&void 0!==i?i:1e9)||(e.name<t.name?-1:1)};for(let n of i.sort(o))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],a=null,l=r.compareCompletions;for(let e of n.sort(((e,t)=>t.score-e.score||l(e.completion,t.completion)))){let t=e.completion;!a||a.label!=t.label||a.detail!=t.detail||null!=a.type&&null!=t.type&&a.type!=t.type||a.apply!=t.apply||a.boost!=t.boost?s.push(e):BT(e.completion)>BT(a)&&(s[s.length-1]=e),a=e.completion}return s}(e,t);if(!s.length)return i&&e.some((e=>e.isPending))?i.setDisabled():null;let a=t.facet(AT).selectOnOpen?0:-1;if(i&&i.selected!=a&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){a=t;break}}return new LT(s,FT(n,a),{pos:e.reduce(((e,t)=>t.hasResult()?Math.min(e,t.from):e),1e8),create:YT,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new LT(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new LT(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class NT{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new NT(zT,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(AT),i=(n.override||t.languageDataAt("autocomplete",wT(t)).map(ET)).map((t=>{let i=this.active.find((e=>e.source==t))||new HT(t,this.active.some((e=>0!=e.state))?1:0);return i.update(e,n)}));i.length==this.active.length&&i.every(((e,t)=>e==this.active[t]))&&(i=this.active);let o=this.open,r=e.effects.some((e=>e.is(UT)));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||i.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let o=n==e.length,r=i==t.length;if(o||r)return o==r;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||r?o=LT.build(i,t,this.id,o,n,r):o&&o.disabled&&!i.some((e=>e.isPending))&&(o=null),!o&&i.every((e=>!e.isPending))&&i.some((e=>e.hasResult()))&&(i=i.map((e=>e.hasResult()?new HT(e.source,0):e)));for(let t of e.effects)t.is(XT)&&(o=o&&o.setSelected(t.value,this.id));return i==this.active&&o==this.open?this:new NT(i,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?qT:VT}}const qT={"aria-autocomplete":"list"},VT={};function FT(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const zT=[];function QT(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(OT);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class HT{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=QT(e,t),i=this;(8&n||16&n&&this.touches(e))&&(i=new HT(i.source,0)),4&n&&0==i.state&&(i=new HT(this.source,1)),i=i.updateFor(e,n);for(let t of e.effects)if(t.is(ST))i=new HT(i.source,1,t.value);else if(t.is(RT))i=new HT(i.source,0);else if(t.is(UT))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(wT(e.state))}}class WT extends HT{constructor(e,t,n,i,o,r){super(e,3,t),this.limit=n,this.result=i,this.from=o,this.to=r}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),s=wT(e.state);if(s>r||!i||2&t&&(wT(e.startState)==this.from||s<this.limit))return new HT(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return function(e,t,n,i){if(!e)return!1;let o=t.sliceDoc(n,i);return"function"==typeof e?e(o,n,i,t):CT(e,!0).test(o)}(i.validFor,e.state,o,r)?new WT(this.source,this.explicit,a,i,o,r):i.update&&(i=i.update(i,o,r,new yT(e.state,s,!1)))?new WT(this.source,this.explicit,a,i,i.from,null!==(n=i.to)&&void 0!==n?n:wT(e.state)):new HT(this.source,1,this.explicit)}map(e){if(e.empty)return this;return(this.result.map?this.result.map(this.result,e):this.result)?new WT(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new HT(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const UT=$_.define({map:(e,t)=>e.map((e=>e.map(t)))}),XT=$_.define(),KT=h_.define({create:()=>NT.start(),update:(e,t)=>e.update(t),provide:e=>[QE.from(e,(e=>e.tooltip)),xE.contentAttributes.from(e,(e=>e.attrs))]});function GT(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(KT).active.find((e=>e.source==t.source));return i instanceof WT&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,i){let{main:o}=e.selection,r=n-o.from,s=i-o.from;return Object.assign(Object.assign({},e.changeByRange((a=>{if(a!=o&&n!=i&&e.sliceDoc(a.from+r,a.from+s)!=e.sliceDoc(n,i))return{range:a};let l=e.toText(t);return{changes:{from:a.from+r,to:i==o.from?a.to:a.from+s,insert:l},range:t_.cursor(a.from+r+l.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,i.from,i.to)),{annotations:OT.of(t.completion)})):n(e,t.completion,i.from,i.to),!0)}const YT=IT(KT,GT);function ZT(e,t="option"){return n=>{let i=n.state.field(KT,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(AT).interactionDelay)return!1;let o,r=1;"page"==t&&(o=YE(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=i.open.options,a=i.open.selected>-1?i.open.selected+r*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:XT.of(a)}),!0}}const JT=e=>!!e.state.field(KT,!1)&&(e.dispatch({effects:ST.of(!0)}),!0);class eM{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tM=bO.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(KT).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(KT),n=e.state.facet(AT);if(!e.selectionSet&&!e.docChanged&&e.startState.field(KT)==t)return;let i=e.transactions.some((e=>{let t=QT(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)}));for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){mO(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some((e=>e.effects.some((e=>e.is(ST)))))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some((e=>e.isPending&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),o):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(KT);for(let e of t.active)e.isPending&&!this.running.some((t=>t.active.source==e.source))&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(AT).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=wT(t),i=new yT(t,n,e.explicit,this.view),o=new eM(e,i);this.running.push(o),Promise.resolve(e.source(i)).then((e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:RT.of(null)}),mO(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(AT).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(AT),i=this.view.state.field(KT);for(let o=0;o<this.running.length;o++){let r=this.running[o];if(void 0===r.done)continue;if(this.running.splice(o--,1),r.done){let i=wT(r.updates.length?r.updates[0].startState:this.view.state),o=Math.min(i,r.done.from+(r.active.explicit?0:1)),s=new WT(r.active.source,r.active.explicit,o,r.done,r.done.from,null!==(e=r.done.to)&&void 0!==e?e:i);for(let e of r.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=i.active.find((e=>e.source==r.active.source));if(s&&s.isPending)if(null==r.done){let e=new HT(r.active.source,0);for(let t of r.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:UT.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(KT,!1);if(t&&t.tooltip&&this.view.state.facet(AT).closeOnBlur){let n=t.open&&YE(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:RT.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:ST.of(!1)})),20),this.composing=0}}}),nM="object"==typeof navigator&&/Win/.test(navigator.platform),iM=v_.highest(xE.domEventHandlers({keydown(e,t){let n=t.state.field(KT,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!nM||!e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],o=n.active.find((e=>e.source==i.source)),r=i.completion.commitCharacters||o.result.commitCharacters;return r&&r.indexOf(e.key)>-1&&GT(t,i),!1}})),oM=xE.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'?︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class rM{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}}class sM{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,Hb.TrackDel),n=e.mapPos(this.to,1,Hb.TrackDel);return null==t||null==n?null:new sM(this.field,t,n)}}class aM{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],o=e.doc.lineAt(t),r=/^\s*/.exec(o.text)[0];for(let o of this.lines){if(n.length){let n=r,s=/^\t*/.exec(o)[0].length;for(let t=0;t<s;t++)n+=e.facet(SR);i.push(t+n.length-s),o=n+o.slice(s)}n.push(o),t+=o.length+1}let s=this.fieldPositions.map((e=>new sM(e.field,i[e.line]+e.from,i[e.line]+e.to)));return{text:n,ranges:s}}static parse(e){let t,n=[],i=[],o=[];for(let r of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(r);){let e=t[1]?+t[1]:null,s=t[2]||t[3]||"",a=-1,l=s.replace(/\\[{}]/g,(e=>e[1]));for(let t=0;t<n.length;t++)(null!=e?n[t].seq==e:l&&n[t].name==l)&&(a=t);if(a<0){let t=0;for(;t<n.length&&(null==e||null!=n[t].seq&&n[t].seq<e);)t++;n.splice(t,0,{seq:e,name:l}),a=t;for(let e of o)e.field>=a&&e.field++}o.push(new rM(a,i.length,t.index,t.index+l.length)),r=r.slice(0,t.index)+s+r.slice(t.index+t[0].length)}r=r.replace(/\\([{}])/g,((e,t,n)=>{for(let e of o)e.line==i.length&&e.from>n&&(e.from--,e.to--);return t})),i.push(r)}return new aM(i,o)}}let lM=OC.widget({widget:new class extends wC{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),cM=OC.mark({class:"cm-snippetField"});class uM{constructor(e,t){this.ranges=e,this.active=t,this.deco=OC.set(e.map((e=>(e.from==e.to?lM:cM).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new uM(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const hM=$_.define({map:(e,t)=>e&&e.map(t)}),dM=$_.define(),pM=h_.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(hM))return n.value;if(n.is(dM)&&e)return new uM(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>xE.decorations.from(e,(e=>e?e.deco:OC.none))});function fM(e,t){return t_.create(e.filter((e=>e.field==t)).map((e=>t_.range(e.from,e.to))))}function gM(e){let t=aM.parse(e);return(e,n,i,o)=>{let{text:r,ranges:s}=t.instantiate(e.state,i),{main:a}=e.state.selection,l={changes:{from:i,to:o==a.from?a.to:o,insert:Mb.of(r)},scrollIntoView:!0,annotations:n?[OT.of(n),j_.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=fM(s,0)),s.some((e=>e.field>0))){let t=new uM(s,0),n=l.effects=[hM.of(t)];void 0===e.state.field(pM,!1)&&n.push($_.appendConfig.of([pM,xM,_M,oM]))}e.dispatch(e.state.update(l))}}function mM(e){return({state:t,dispatch:n})=>{let i=t.field(pM,!1);if(!i||e<0&&0==i.active)return!1;let o=i.active+e,r=e>0&&!i.ranges.some((t=>t.field==o+e));return n(t.update({selection:fM(i.ranges,o),effects:hM.of(r?null:new uM(i.ranges,o)),scrollIntoView:!0})),!0}}const vM=[{key:"Tab",run:mM(1),shift:mM(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(pM,!1)&&(t(e.update({effects:hM.of(null)})),!0)}],yM=o_.define({combine:e=>e.length?e[0]:vM}),xM=v_.highest(SE.compute([yM],(e=>e.facet(yM))));function bM(e,t){return Object.assign(Object.assign({},t),{apply:gM(e)})}const _M=xE.domEventHandlers({mousedown(e,t){let n,i=t.state.field(pM,!1);if(!i||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let o=i.ranges.find((e=>e.from<=n&&e.to>=n));return!(!o||o.field==i.active)&&(t.dispatch({selection:fM(i.ranges,o.field),effects:hM.of(i.ranges.some((e=>e.field>o.field))?new uM(i.ranges,o.field):null),scrollIntoView:!0}),!0)}}),wM={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},CM=$_.define({map(e,t){let n=t.mapPos(e,-1,Hb.TrackAfter);return null==n?void 0:n}}),OM=new class extends X_{};OM.startSide=1,OM.endSide=-1;const kM=h_.define({create:()=>Z_.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(CM)&&(e=e.update({add:[OM.range(n.value,n.value+1)]}));return e}});const EM="()[]{}<>";function SM(e){for(let t=0;t<EM.length;t+=2)if(EM.charCodeAt(t)==e)return EM.charAt(t+1);return Fb(e<128?e:e+1)}const RM="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),TM=xE.inputHandler.of(((e,t,n,i)=>{if((RM?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(i.length>2||2==i.length&&1==zb(Vb(i,0))||t!=o.from||n!=o.to)return!1;let r=function(e,t){let n=function(e,t){return e.languageDataAt("closeBrackets",t)[0]||wM}(e,e.selection.main.head),i=n.brackets||wM.brackets;for(let o of i){let r=SM(Vb(o,0));if(t==o)return r==o?$M(e,o,i.indexOf(o+o+o)>-1,n):PM(e,o,r,n.before||wM.before);if(t==r&&MM(e,e.selection.main.from))return DM(e,o,r)}return null}(e.state,i);return!!r&&(e.dispatch(r),!0)}));function MM(e,t){let n=!1;return e.field(kM).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function AM(e,t){let n=e.sliceString(t,t+2);return n.slice(0,zb(Vb(n,0)))}function PM(e,t,n,i){let o=null,r=e.changeByRange((r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:n,from:r.to}],effects:CM.of(r.to+t.length),range:t_.range(r.anchor+t.length,r.head+t.length)};let s=AM(e.doc,r.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:t+n,from:r.head},effects:CM.of(r.head+t.length),range:t_.cursor(r.head+t.length)}:{range:o=r}}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function DM(e,t,n){let i=null,o=e.changeByRange((t=>t.empty&&AM(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:t_.cursor(t.head+n.length)}:i={range:t}));return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function $M(e,t,n,i){let o=i.stringPrefixes||wM.stringPrefixes,r=null,s=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:CM.of(i.to+t.length),range:t_.range(i.anchor+t.length,i.head+t.length)};let s,a=i.head,l=AM(e.doc,a);if(l==t){if(jM(e,a))return{changes:{insert:t+t,from:a},effects:CM.of(a+t.length),range:t_.cursor(a+t.length)};if(MM(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:t_.cursor(a+i.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(s=IM(e,a-2*t.length,o))>-1&&jM(e,s))return{changes:{insert:t+t+t+t,from:a},effects:CM.of(a+t.length),range:t_.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=F_.Word&&IM(e,a,o)>-1&&!function(e,t,n,i){let o=gR(e).resolveInner(t,-1),r=i.reduce(((e,t)=>Math.max(e,t.length)),0);for(let s=0;s<5;s++){let s=e.sliceDoc(o.from,Math.min(o.to,o.from+n.length+r)),a=s.indexOf(n);if(!a||a>-1&&i.indexOf(s.slice(0,a))>-1){let t=o.firstChild;for(;t&&t.from==o.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=o.to==t&&o.parent;if(!l)break;o=l}return!1}(e,a,t,o))return{changes:{insert:t+t,from:a},effects:CM.of(a+t.length),range:t_.cursor(a+t.length)}}return{range:r=i}}));return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function jM(e,t){let n=gR(e).resolveInner(t+1);return n.parent&&n.from==t}function IM(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=F_.Word)return t;for(let o of n){let n=t-o.length;if(e.sliceDoc(n,t)==o&&i(e.sliceDoc(n-1,n))!=F_.Word)return n}return-1}function BM(e={}){return[iM,KT,AT.of(e),tM,NM,oM]}const LM=[{key:"Ctrl-Space",run:JT},{mac:"Alt-`",run:JT},{key:"Escape",run:e=>{let t=e.state.field(KT,!1);return!(!t||!t.active.some((e=>0!=e.state)))&&(e.dispatch({effects:RT.of(null)}),!0)}},{key:"ArrowDown",run:ZT(!0)},{key:"ArrowUp",run:ZT(!1)},{key:"PageDown",run:ZT(!0,"page")},{key:"PageUp",run:ZT(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(KT,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(AT).interactionDelay)&&GT(e,t.open.options[t.open.selected])}}],NM=v_.highest(SE.computeN([AT],(e=>e.facet(AT).defaultKeymap?[LM]:[])));function qM(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(i(n.update(o)),!0)}}const VM=qM(UM,0),FM=qM(WM,0),zM=qM(((e,t)=>WM(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),o=n.to<=i.to?i:e.doc.lineAt(n.to);o.from>i.from&&o.from==n.to&&(o=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=o.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:o.to})}return t}(t))),0);function QM(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}const HM=50;function WM(e,t,n=t.selection.ranges){let i=n.map((e=>QM(t,e.from).block));if(!i.every((e=>e)))return null;let o=n.map(((e,n)=>function(e,{open:t,close:n},i,o){let r,s,a=e.sliceDoc(i-HM,i),l=e.sliceDoc(o,o+HM),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,h=a.length-c;if(a.slice(h-t.length,h)==t&&l.slice(u,u+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:o+u,margin:u&&1}};o-i<=2*HM?r=s=e.sliceDoc(i,o):(r=e.sliceDoc(i,i+HM),s=e.sliceDoc(o-HM,o));let d=/^\s*/.exec(r)[0].length,p=/\s*$/.exec(s)[0].length,f=s.length-p-n.length;return r.slice(d,d+t.length)==t&&s.slice(f,f+n.length)==n?{open:{pos:i+d+t.length,margin:/\s/.test(r.charAt(d+t.length))?1:0},close:{pos:o-p-n.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(t,i[n],e.from,e.to)));if(2!=e&&!o.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>o[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}])))};if(1!=e&&o.some((e=>e))){let e=[];for(let t,n=0;n<o.length;n++)if(t=o[n]){let o=i[n],{open:r,close:s}=t;e.push({from:r.pos-o.open.length,to:r.pos+r.margin},{from:s.pos-s.margin,to:s.pos+o.close.length})}return{changes:e}}return null}function UM(e,t,n=t.selection.ranges){let i=[],o=-1;for(let{from:e,to:r}of n){let n=i.length,s=1e9,a=QM(t,e).line;if(a){for(let n=e;n<=r;){let l=t.doc.lineAt(n);if(l.from>o&&(e==r||r>l.from)){o=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),i.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=s);i.length==n+1&&(i[n].single=!0)}}if(2!=e&&i.some((e=>e.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:n,indent:o,empty:r,single:s}of i)!s&&r||e.push({from:t.from+o,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:o}of i)if(n>=0){let i=t.from+n,r=i+o.length;" "==t.text[r-t.from]&&r++,e.push({from:i,to:r})}return{changes:e}}return null}function XM(e,t){return t_.create(e.ranges.map(t),e.mainIndex)}function KM(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function GM({state:e,dispatch:t},n){let i=XM(e.selection,n);return!i.eq(e.selection,!0)&&(t(KM(e,i)),!0)}function YM(e,t){return t_.cursor(t?e.to:e.from)}function ZM(e,t){return GM(e,(n=>n.empty?e.moveByChar(n,t):YM(n,t)))}function JM(e){return e.textDirectionAt(e.state.selection.main.head)==IC.LTR}const eA=e=>ZM(e,!JM(e)),tA=e=>ZM(e,JM(e));function nA(e,t){return GM(e,(n=>n.empty?e.moveByGroup(n,t):YM(n,t)))}function iA(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function oA(e,t,n){let i,o,r=gR(e).resolveInner(t.head),s=n?lS.closedBy:lS.openedBy;for(let i=t.head;;){let t=n?r.childAfter(i):r.childBefore(i);if(!t)break;iA(e,t,s)?r=t:i=n?t.to:t.from}return o=r.type.prop(s)&&(i=n?cT(e,r.from,1):cT(e,r.to,-1))&&i.matched?n?i.end.to:i.end.from:n?r.to:r.from,t_.cursor(o,n?-1:1)}function rA(e,t){return GM(e,(n=>{if(!n.empty)return YM(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)}))}const sA=e=>rA(e,!1),aA=e=>rA(e,!0);function lA(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,i=0,o=0;if(n){for(let t of e.state.facet(xE.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(i=Math.max(null==n?void 0:n.top,i)),(null==n?void 0:n.bottom)&&(o=Math.max(null==n?void 0:n.bottom,o))}t=e.scrollDOM.clientHeight-i-o}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:o,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function cA(e,t){let n,i=lA(e),{state:o}=e,r=XM(o.selection,(n=>n.empty?e.moveVertically(n,t,i.height):YM(n,t)));if(r.eq(o.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(o.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+i.marginTop,l=s.bottom-i.marginBottom;t&&t.top>a&&t.bottom<l&&(n=xE.scrollIntoView(r.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(KM(o,r),{effects:n}),!0}const uA=e=>cA(e,!1),hA=e=>cA(e,!0);function dA(e,t,n){let i=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?i.to:i.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(o=t_.cursor(i.from+n))}return o}function pA(e,t){let n=XM(e.state.selection,(e=>{let n=t(e);return t_.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(KM(e.state,n)),!0)}function fA(e,t){return pA(e,(n=>e.moveByChar(n,t)))}const gA=e=>fA(e,!JM(e)),mA=e=>fA(e,JM(e));function vA(e,t){return pA(e,(n=>e.moveByGroup(n,t)))}function yA(e,t){return pA(e,(n=>e.moveVertically(n,t)))}const xA=e=>yA(e,!1),bA=e=>yA(e,!0);function _A(e,t){return pA(e,(n=>e.moveVertically(n,t,lA(e).height)))}const wA=e=>_A(e,!1),CA=e=>_A(e,!0),OA=({state:e,dispatch:t})=>(t(KM(e,{anchor:0})),!0),kA=({state:e,dispatch:t})=>(t(KM(e,{anchor:e.doc.length})),!0),EA=({state:e,dispatch:t})=>(t(KM(e,{anchor:e.selection.main.anchor,head:0})),!0),SA=({state:e,dispatch:t})=>(t(KM(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function RA(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,o=i.changeByRange((i=>{let{from:o,to:r}=i;if(o==r){let s=t(i);s<o?(n="delete.backward",s=TA(e,s,!1)):s>o&&(n="delete.forward",s=TA(e,s,!0)),o=Math.min(o,s),r=Math.max(r,s)}else o=TA(e,o,!1),r=TA(e,r,!0);return o==r?{range:i}:{changes:{from:o,to:r},range:t_.cursor(o,o<i.head?-1:1)}}));return!o.changes.empty&&(e.dispatch(i.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?xE.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function TA(e,t,n){if(e instanceof xE)for(let i of e.state.facet(xE.atomicRanges).map((t=>t(e))))i.between(t,t,((e,i)=>{e<t&&i>t&&(t=n?i:e)}));return t}const MA=(e,t,n)=>RA(e,(i=>{let o,r,s=i.from,{state:a}=e,l=a.doc.lineAt(s);if(n&&!t&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,s-l.from))){if("\t"==o[o.length-1])return s-1;let e=uw(o,a.tabSize)%RR(a)||RR(a);for(let t=0;t<e&&" "==o[o.length-1-t];t++)s--;r=s}else r=qb(l.text,s-l.from,t,t)+l.from,r==s&&l.number!=(t?a.doc.lines:1)?r+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(r-l.from,s-l.from))&&(r=qb(l.text,r-l.from,!1,!1)+l.from);return r})),AA=e=>MA(e,!1,!0),PA=e=>MA(e,!0,!1),DA=(e,t)=>RA(e,(n=>{let i=n.head,{state:o}=e,r=o.doc.lineAt(i),s=o.charCategorizer(i);for(let e=null;;){if(i==(t?r.to:r.from)){i==n.head&&r.number!=(t?o.doc.lines:1)&&(i+=t?1:-1);break}let a=qb(r.text,i-r.from,t)+r.from,l=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=s(l);if(null!=e&&c!=e)break;" "==l&&i==n.head||(e=c),i=a}return i})),$A=e=>DA(e,!1);function jA(e){let t=[],n=-1;for(let i of e.selection.ranges){let o=e.doc.lineAt(i.from),r=e.doc.lineAt(i.to);if(i.empty||i.to!=r.from||(r=e.doc.lineAt(i.to-1)),n>=o.number){let e=t[t.length-1];e.to=r.to,e.ranges.push(i)}else t.push({from:o.from,to:r.to,ranges:[i]});n=r.number+1}return t}function IA(e,t,n){if(e.readOnly)return!1;let i=[],o=[];for(let t of jA(e)){if(n?t.to==e.doc.length:0==t.from)continue;let r=e.doc.lineAt(n?t.to+1:t.from-1),s=r.length+1;if(n){i.push({from:t.to,to:r.to},{from:t.from,insert:r.text+e.lineBreak});for(let n of t.ranges)o.push(t_.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)))}else{i.push({from:r.from,to:t.from},{from:t.to,insert:e.lineBreak+r.text});for(let e of t.ranges)o.push(t_.range(e.anchor-s,e.head-s))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:t_.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function BA(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of jA(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const LA=qA(!1),NA=qA(!0);function qA(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange((n=>{let{from:i,to:o}=n,r=t.doc.lineAt(i),s=!e&&i==o&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,i=gR(e).resolveInner(t),o=i.childBefore(t),r=i.childAfter(t);return o&&r&&o.to<=t&&r.from>=t&&(n=o.type.prop(lS.closedBy))&&n.indexOf(r.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(o.to,r.from))?{from:o.to,to:r.from}:null}(t,i);e&&(i=o=(o<=r.to?r:t.doc.lineAt(o)).to);let a=new AR(t,{simulateBreak:i,simulateDoubleBreak:!!s}),l=MR(a,i);for(null==l&&(l=uw(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));o<r.to&&/\s/.test(r.text[o-r.from]);)o++;s?({from:i,to:o}=s):i>r.from&&i<r.from+100&&!/\S/.test(r.text.slice(0,i))&&(i=r.from);let c=["",TR(t,l)];return s&&c.push(TR(t,a.lineIndent(r.from,-1))),{changes:{from:i,to:o,insert:Mb.of(c)},range:t_.cursor(i+1+c[1].length)}}));return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function VA(e,t){let n=-1;return e.changeByRange((i=>{let o=[];for(let r=i.from;r<=i.to;){let s=e.doc.lineAt(r);s.number>n&&(i.empty||i.to>s.from)&&(t(s,o,i),n=s.number),r=s.to+1}let r=e.changes(o);return{changes:o,range:t_.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}}))}const FA=[{key:"ArrowLeft",run:eA,shift:gA,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>nA(e,!JM(e)),shift:e=>vA(e,!JM(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>GM(e,(t=>dA(e,t,!JM(e)))),shift:e=>pA(e,(t=>dA(e,t,!JM(e)))),preventDefault:!0},{key:"ArrowRight",run:tA,shift:mA,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>nA(e,JM(e)),shift:e=>vA(e,JM(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>GM(e,(t=>dA(e,t,JM(e)))),shift:e=>pA(e,(t=>dA(e,t,JM(e)))),preventDefault:!0},{key:"ArrowUp",run:sA,shift:xA,preventDefault:!0},{mac:"Cmd-ArrowUp",run:OA,shift:EA},{mac:"Ctrl-ArrowUp",run:uA,shift:wA},{key:"ArrowDown",run:aA,shift:bA,preventDefault:!0},{mac:"Cmd-ArrowDown",run:kA,shift:SA},{mac:"Ctrl-ArrowDown",run:hA,shift:CA},{key:"PageUp",run:uA,shift:wA},{key:"PageDown",run:hA,shift:CA},{key:"Home",run:e=>GM(e,(t=>dA(e,t,!1))),shift:e=>pA(e,(t=>dA(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:OA,shift:EA},{key:"End",run:e=>GM(e,(t=>dA(e,t,!0))),shift:e=>pA(e,(t=>dA(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:kA,shift:SA},{key:"Enter",run:LA,shift:LA},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:AA,shift:AA},{key:"Delete",run:PA},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$A},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>DA(e,!0)},{mac:"Mod-Backspace",run:e=>RA(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>RA(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}))}].concat([{key:"Ctrl-b",run:eA,shift:gA,preventDefault:!0},{key:"Ctrl-f",run:tA,shift:mA},{key:"Ctrl-p",run:sA,shift:xA},{key:"Ctrl-n",run:aA,shift:bA},{key:"Ctrl-a",run:e=>GM(e,(t=>t_.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>pA(e,(t=>t_.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>GM(e,(t=>t_.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>pA(e,(t=>t_.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:PA},{key:"Ctrl-h",run:AA},{key:"Ctrl-k",run:e=>RA(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}))},{key:"Ctrl-Alt-h",run:$A},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:Mb.of(["",""])},range:t_.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),o=n==i.from?n-1:qb(i.text,n-i.from,!1)+i.from,r=n==i.to?n+1:qb(i.text,n-i.from,!0)+i.from;return{changes:{from:o,to:r,insert:e.doc.slice(n,r).append(e.doc.slice(o,n))},range:t_.cursor(r)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:hA}].map((e=>({mac:e.key,run:e.run,shift:e.shift})))),zA=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>GM(e,(t=>oA(e.state,t,!JM(e)))),shift:e=>pA(e,(t=>oA(e.state,t,!JM(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>GM(e,(t=>oA(e.state,t,JM(e)))),shift:e=>pA(e,(t=>oA(e.state,t,JM(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>IA(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>BA(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>IA(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>BA(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=t_.create([n.main]):n.main.empty||(i=t_.create([t_.cursor(n.main.head)])),!!i&&(t(KM(e,i)),!0)}},{key:"Mod-Enter",run:NA},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=jA(e).map((({from:t,to:n})=>t_.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:t_.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=XM(e.selection,(t=>{let n=gR(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return t_.range(n.to,n.from)}return t}));return!n.eq(e.selection)&&(t(KM(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(VA(e,((t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let o=uw(i,e.tabSize),r=0,s=TR(e,Math.max(0,o-RR(e)));for(;r<i.length&&r<s.length&&i.charCodeAt(r)==s.charCodeAt(r);)r++;n.push({from:t.from+r,to:t.from+i.length,insert:s.slice(r)})})),{userEvent:"delete.dedent"})),!0)},{key:"Mod-]",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(VA(e,((t,n)=>{n.push({from:t.from,insert:e.facet(SR)})})),{userEvent:"input.indent"})),!0)},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new AR(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=VA(e,((t,o,r)=>{let s=MR(i,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=TR(e,s);(a!=l||r.from<t.from+a.length)&&(n[t.from]=s,o.push({from:t.from,to:t.from+a.length,insert:l}))}));return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(jA(t).map((({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n})))),i=XM(t.selection,(t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),o=e.coordsAtPos(t.head,t.assoc||1);o&&(n=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)})).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let i=!1,o=XM(e.selection,(t=>{let n=cT(e,t.head,-1)||cT(e,t.head,1)||t.head>0&&cT(e,t.head-1,1)||t.head<e.doc.length&&cT(e,t.head+1,-1);if(!n||!n.end)return t;i=!0;let o=n.start.from==t.head?n.end.to:n.end.from;return t_.cursor(o)}));return!!i&&(t(KM(e,o)),!0)}(e,t)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=QM(e.state,n.from);return i.line?VM(e):!!i.block&&zM(e)}},{key:"Alt-A",run:FM},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(FA);function QA(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i];"string"==typeof o?e.setAttribute(i,o):null!=o&&(e[i]=o)}t++}for(;t<arguments.length;t++)HA(e,arguments[t]);return e}function HA(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)HA(e,t[n])}}class WA{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class UA{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,o=n.facet(rP).markerFilter;o&&(i=o(i,n));let r=e.slice().sort(((e,t)=>e.from-t.from||e.to-t.to)),s=new J_,a=[],l=0;for(let e=0;;){let t,i,o=e==r.length?null:r[e];if(!o&&!a.length)break;for(a.length?(t=l,i=a.reduce(((e,t)=>Math.min(e,t.to)),o&&o.from>t?o.from:1e8)):(t=o.from,i=o.to,a.push(o),e++);e<r.length;){let n=r[e];if(n.from!=t||!(n.to>n.from||n.to==t)){i=Math.min(n.from,i);break}a.push(n),e++,i=Math.min(n.to,i)}let c=fP(a);if(a.some((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from)))s.add(t,t,OC.widget({widget:new lP(c),diagnostics:a.slice()}));else{let e=a.reduce(((e,t)=>t.markClass?e+" "+t.markClass:e),"");s.add(t,i,OC.mark({class:"cm-lintRange cm-lintRange-"+c+e,diagnostics:a.slice(),inclusiveEnd:a.some((e=>e.to>i))}))}l=i;for(let e=0;e<a.length;e++)a[e].to<=l&&a.splice(e--,1)}let c=s.finish();return new UA(c,t,XA(c))}}function XA(e,t=null,n=0){let i=null;return e.between(n,1e9,((e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(i){if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new WA(i.from,n,i.diagnostic)}else i=new WA(e,n,t||o.diagnostics[0])})),i}function KA(e,t){return e.field(JA,!1)?t:t.concat($_.appendConfig.of(gP))}const GA=$_.define(),YA=$_.define(),ZA=$_.define(),JA=h_.define({create:()=>new UA(OC.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);i=XA(n,e.selected.diagnostic,o)||XA(n,null,o)}!n.size&&o&&t.state.facet(rP).autoPanel&&(o=null),e=new UA(n,o,i)}for(let n of t.effects)if(n.is(GA)){let i=t.state.facet(rP).autoPanel?n.value.length?uP.open:null:e.panel;e=UA.init(n.value,i,t.state)}else n.is(YA)?e=new UA(e.diagnostics,n.value?uP.open:null,e.selected):n.is(ZA)&&(e=new UA(e.diagnostics,e.panel,n.value));return e},provide:e=>[iS.from(e,(e=>e.panel)),xE.decorations.from(e,(e=>e.diagnostics))]}),eP=OC.mark({class:"cm-lintRange cm-lintRange-active"});function tP(e,t,n){let i,{diagnostics:o}=e.state.field(JA),r=-1,s=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return i=a.diagnostics,r=e,s=o,!1}));let a=e.state.facet(rP).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:r,end:s,above:e.state.doc.lineAt(r).to<s,create:()=>({dom:nP(e,i)})}:null}function nP(e,t){return QA("ul",{class:"cm-tooltip-lint"},t.map((t=>aP(e,t,!1))))}const iP=e=>{let t=e.state.field(JA,!1);return!(!t||!t.panel)&&(e.dispatch({effects:YA.of(!1)}),!0)},oP=bO.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(rP);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(rP);t.length&&function(e,t,n){let i=[],o=-1;for(let r of e)r.then((n=>{i.push(n),clearTimeout(o),i.length==e.length?t(i):o=setTimeout((()=>t(i)),200)}),n)}(t.map((e=>Promise.resolve(e(this.view)))),(t=>{this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:KA(e,[GA.of(t)])}}(this.view.state,t.reduce(((e,t)=>e.concat(t)))))}),(e=>{mO(this.view.state,e)}))}}update(e){let t=e.state.facet(rP);(e.docChanged||t!=e.startState.facet(rP)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});const rP=o_.define({combine:e=>Object.assign({sources:e.map((e=>e.source)).filter((e=>null!=e))},U_(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function sP(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some((e=>e.toLowerCase()==i.toLowerCase()))){t.push(i);continue e}}t.push("")}return t}function aP(e,t,n){var i;let o=n?sP(t.actions):[];return QA("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},QA("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map(((n,i)=>{let r=!1,s=i=>{if(i.preventDefault(),r)return;r=!0;let o=XA(e.state.field(JA).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:a}=n,l=o[i]?a.indexOf(o[i]):-1,c=l<0?a:[a.slice(0,l),QA("u",a.slice(l,l+1)),a.slice(l+1)];return QA("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${o[i]})"`}.`},c)})),t.source&&QA("div",{class:"cm-diagnosticSource"},t.source))}class lP extends wC{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return QA("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class cP{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=aP(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class uP{constructor(e){this.view=e,this.items=[];this.list=QA("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)iP(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],i=sP(n.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=XA(this.view.state.field(JA).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=QA("div",{class:"cm-panel-lint"},this.list,QA("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>iP(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(JA).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(JA),n=0,i=!1,o=null,r=new Set;for(e.between(0,this.view.state.doc.length,((e,s,{spec:a})=>{for(let e of a.diagnostics){if(r.has(e))continue;r.add(e);let s,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(s=new cP(this.view,e),this.items.splice(n,0,s),i=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),o=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}}));n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new cP(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=XA(this.view.state.field(JA).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:ZA.of(t)})}static open(e){return new uP(e)}}function hP(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const dP=xE.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:hP("#d11")},".cm-lintRange-warning":{backgroundImage:hP("orange")},".cm-lintRange-info":{backgroundImage:hP("#999")},".cm-lintRange-hint":{backgroundImage:hP("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function pP(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function fP(e){let t="hint",n=1;for(let i of e){let e=pP(i.severity);e>n&&(n=e,t=i.severity)}return t}const gP=[JA,xE.decorations.compute([JA],(e=>{let{selected:t,panel:n}=e.field(JA);return t&&n&&t.from!=t.to?OC.set([eP.range(t.from,t.to)]):OC.none})),GE(tP,{hideOn:function(e,t){let n=t.pos,i=t.end||n,o=e.state.facet(rP).hideOn(e,n,i);if(null!=o)return o;let r=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(GA)))&&!e.changes.touchesRange(r.from,Math.max(r.to,i)))}}),dP];class mP{constructor(e,t,n,i,o,r,s,a,l,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=o,this.score=r,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new mP(e,[],t,n,n,0,[],0,i?new vP(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:o}=this.p,r=this.reducePos<this.pos-25;r&&this.setLookAhead(this.pos);let s=o.dynamicPrecedence(i);if(s&&(this.score+=s),0==n)return this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,r?8:4,!0),void this.reduceContext(i,this.reducePos);let a=this.stack.length-3*(n-1)-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(null===(t=this.p.parser.nodeSet.types[i])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let u=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-u;if(i<o.minRepeatTerm||131072&e){let e=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,e,h+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=o.getGoto(e,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,o=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,i=this.buffer.length;if(0==i&&e.parent&&(i=e.bufferBase-e.parent.bufferBase,e=e.parent),i>0&&0==e.buffer[i-4]&&e.buffer[i-1]>-1){if(t==n)return;if(e.buffer[i-2]>=t)return void(e.buffer[i-2]=n)}}if(o&&this.pos!=n){let o=this.buffer.length;if(o>0&&0!=this.buffer[o-4]){let e=!1;for(let t=o;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4);else{let o=e,{parser:r}=this.p;(i>this.pos||t<=r.maxNode)&&(this.pos=i,r.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,n),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new mP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new yP(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(!(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i,o=0;o<t.length;o+=2)(i=t[o+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[o],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some(((e,t)=>1&t&&e==i))||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let o=this.split();o.pushState(i,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[e],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(65536&t))return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,o=this.stack.length-3*n;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,o)=>{if(!t.includes(i))return t.push(i),e.allActions(i,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-o;if(n>1){let i=65535&t,o=this.stack.length-3*n;if(o>=0&&e.getGoto(this.stack[o],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,o+1);if(null!=e)return e}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new vP(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class vP{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class yP{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class xP{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new xP(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new xP(this.stack,this.pos,this.index)}}function bP(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,o=0;i<e.length;){let r=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){r=65535;break}t>=92&&t--,t>=34&&t--;let o=t-32;if(o>=46&&(o-=46,n=!0),r+=o,n)break;r*=46}n?n[o++]=r:n=new t(r)}return n}class _P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wP=new _P;class CP{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wP,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<n.from;){if(!i)return null;let e=this.ranges[--i];o-=n.from-e.to,n=e}for(;t<0?o>n.to:o>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];o+=e.from-n.to,n=e}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,n,i=this.chunkOff+e;if(i>=0&&i<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(e,1);if(null==i)return-1;if(t=i,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,i=this.range;for(;i.to<=t;)i=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=wP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class OP{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;!function(e,t,n,i,o,r){let s=0,a=1<<i,{dialect:l}=n.p.parser;e:for(;a&e[s];){let n=e[s+1];for(let i=s+3;i<n;i+=2)if((e[i+1]&a)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||SP(n,t.token.value,o,r))){t.acceptToken(n);break}}let i=t.next,c=0,u=e[s+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c<u;){let o=c+u>>1,r=n+o+(o<<1),a=e[r],l=e[r+1]||65536;if(i<a)u=o;else{if(!(i>=l)){s=e[r+2],t.advance();continue e}c=o+1}}break}s=e[n+3*u-1]}}(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}OP.prototype.contextual=OP.prototype.fallback=OP.prototype.extend=!1,OP.prototype.fallback=OP.prototype.extend=!1;class kP{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function EP(e,t,n){for(let i,o=t;65535!=(i=e[o]);o++)if(i==n)return o-t;return-1}function SP(e,t,n,i){let o=EP(n,i,t);return o<0||EP(n,i,e)<o}const RP="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let TP=null;function MP(e,t,n){let i=e.cursor(gS.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}class AP{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?MP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?MP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=n.children[i],r=this.start[t]+n.positions[i];if(r>e)return this.nextStart=r,null;if(o instanceof mS){if(r==e){if(r<this.safeFrom)return null;let e=r+o.length;if(e<=this.safeTo){let t=o.prop(lS.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[t]++,r+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(r),this.index.push(0))}else this.index[t]++,this.nextStart=r+o.length}}}class PP{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new _P))}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:o}=i,r=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let i=0;i<o.length;i++){if(!(1<<i&r))continue;let l=o[i],c=this.tokens[i];if((!n||l.fallback)&&((l.contextual||c.start!=e.pos||c.mask!=r||c.context!=s)&&(this.updateCachedToken(c,l,e),c.mask=r,c.context=s),c.lookAhead>c.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let i=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(n=c,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new _P,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new _P,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let o=t.specializers[i](this.stream.read(e.start,e.end),n);if(o>=0&&n.p.parser.dialect.allows(o>>1)){1&o?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:o}=e,{parser:r}=e.p,{data:s}=r;for(let e=0;e<2;e++)for(let a=r.stateSlot(o,e?2:1);;a+=3){if(65535==s[a]){if(1!=s[a+1]){0==i&&2==s[a+1]&&(i=this.putAction(NP(s,a+2),t,n,i));break}a=NP(s,a+2)}s[a]==t&&(i=this.putAction(NP(s,a+1),t,n,i))}return i}}class DP{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new CP(t,i),this.tokens=new PP(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[mP.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>4*e.bufferLength?new AP(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,o=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<n.length;r++){let s=n[r];for(;;){if(this.tokens.mainToken=null,s.pos>i)o.push(s);else{if(this.advanceStack(s,o,n))continue;{e||(e=[],t=[]),e.push(s);let n=this.tokens.getMainToken(s);t.push(n.value,n.end)}}break}}if(!o.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return RP&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw RP&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,o);if(n)return RP&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(o.length>e)for(o.sort(((e,t)=>t.score-e.score));o.length>e;)o.pop();o.some((e=>e.reducePos>i))&&this.recovering--}else if(o.length>1){e:for(let e=0;e<o.length-1;e++){let t=o[e];for(let n=e+1;n<o.length;n++){let i=o[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if(!((t.score-i.score||t.buffer.length-i.buffer.length)>0)){o.splice(e--,1);continue e}o.splice(n--,1)}}}o.length>12&&o.splice(12,o.length-12)}this.minStackPos=o[0].pos;for(let e=1;e<o.length;e++)o[e].pos<this.minStackPos&&(this.minStackPos=o[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let i=e.pos,{parser:o}=this,r=RP?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(i);s;){let i=this.parser.nodeSet.types[s.type.id]==s.type?o.getGoto(e.state,s.type.id):-1;if(i>-1&&s.length&&(!t||(s.prop(lS.contextHash)||0)==n))return e.useNode(s,i),RP&&console.log(r+this.stackID(e)+` (via reuse of ${o.getName(s.type.id)})`),!0;if(!(s instanceof mS)||0==s.children.length||s.positions[0]>0)break;let a=s.children[0];if(!(a instanceof mS&&0==s.positions[0]))break;s=a}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),RP&&console.log(r+this.stackID(e)+` (via always-reduce ${o.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let s=0;s<a.length;){let l=a[s++],c=a[s++],u=a[s++],h=s==a.length||!n,d=h?e:e.split(),p=this.tokens.mainToken;if(d.apply(l,c,p?p.start:d.pos,u),RP&&console.log(r+this.stackID(d)+` (via ${65536&l?`reduce of ${o.getName(65535&l)}`:"shift"} for ${o.getName(c)} @ ${i}${d==e?"":", split"})`),h)return!0;d.pos>i?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return $P(e,t),!0}}runRecovery(e,t,n){let i=null,o=!1;for(let r=0;r<e.length;r++){let s=e[r],a=t[r<<1],l=t[1+(r<<1)],c=RP?this.stackID(s)+" -> ":"";if(s.deadEnd){if(o)continue;if(o=!0,s.restart(),RP&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))continue}let u=s.split(),h=c;for(let e=0;u.forceReduce()&&e<10;e++){if(RP&&console.log(h+this.stackID(u)+" (via force-reduce)"),this.advanceFully(u,n))break;RP&&(h=this.stackID(u)+" -> ")}for(let e of s.recoverByInsert(a))RP&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),RP&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),$P(s,n)):(!i||i.score<s.score)&&(i=s)}return i}stackToTree(e){return e.close(),mS.build({buffer:xP.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(TP||(TP=new WeakMap)).get(e);return t||TP.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function $P(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}class jP{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}const IP=e=>e;class BP{constructor(e){this.start=e.start,this.shift=e.shift||IP,this.reduce=e.reduce||IP,this.reuse=e.reuse||IP,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class LP extends jS{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map((t=>e.topRules[t][1])),i=[];for(let e=0;e<t.length;e++)i.push([]);function o(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=lS[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)o(i,e,t[n++]);else{let r=t[n+-i];for(let s=-i;s>0;s--)o(t[n++],e,r);n++}}}this.nodeSet=new dS(t.map(((t,o)=>hS.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:i[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=rS;let r=bP(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(qP),this.states=bP(e.states,Uint32Array),this.data=bP(e.stateData),this.goto=bP(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map((e=>"number"==typeof e?new OP(r,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new DP(this,e,t,n);for(let o of this.wrappers)i=o(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let o=i[t+1];;){let t=i[o++],r=1&t,s=i[o++];if(r&&n)return s;for(let n=o+(t>>1);o<n;o++)if(i[o]==e)return s;if(r)return-1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let o,r=this.stateSlot(e,i?2:1);;r+=3){if(65535==(o=n[r])){if(1!=n[r+1]){if(2==n[r+1])return NP(n,r+2);break}o=n[r=NP(n,r+2)]}if(o==t||0==o)return NP(n,r+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=NP(this.data,n+2)}i=t(NP(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=NP(this.data,n+2)}if(!(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(LP.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,i)=>{let o=e.specializers.find((e=>e.from==n.external));if(!o)return n;let r=Object.assign(Object.assign({},n),{external:o.to});return t.specializers[i]=qP(r),r}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n,o=this.dialects[t[e]];65535!=(n=this.data[o++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[n]=1;return new jP(e,n,i)}static deserialize(e){return new LP(e)}}function NP(e,t){return e[t]|e[t+1]<<16}function qP(e){if(e.external){let t=e.extend?1:0;return(n,i)=>e.external(n,i)<<1|t}return e.get}const VP=122,FP=123,zP=128,QP=4,HP=131,WP=7,UP=8,XP=9,KP=10,GP=139,YP=19,ZP=140,JP=23,eD=141,tD=27,nD=37,iD=41,oD=145,rD=146,sD=147,aD=148,lD=47,cD=68,uD=154,hD=70,dD=155,pD=72,fD=156,gD=76,mD=161,vD=79,yD=80,xD=81,bD=167,_D=89,wD=90,CD=169,OD=97,kD=171,ED=98,SD=100,RD=101,TD="undefined"!=typeof process&&process.env&&/\bfparse(:dbg)?\b/.test(process.env.LOG),MD="undefined"!=typeof process&&process.env&&/\bfparse:dbg\b/.test(process.env.LOG),AD="undefined"!=typeof process&&process.env&&/\bcontext\b/.test(process.env.LOG),PD=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],DD=ID("\n\r"),$D="*".charCodeAt(0),jD=ID("'./-+*^");function ID(e){return Array.from(e).map((e=>e.charCodeAt(0)))}function BD(e){return e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}function LD(e,t){return t.concat(e.split(/\n/g).join("\n"+t))}function ND(e,t=0){const n=e.peek(t);return n===$D&&e.peek(t+1)===$D?{offset:2,token:"**"}:(i=n,jD.includes(i)?{offset:1,token:String.fromCharCode(n)}:null);var i}function qD(e,t=0,n=!1){for(let o=!1,r=[],s=0;;s++){const a=e.peek(t+s);if(!(63===(i=a)||i>=65&&i<=90||95===i||i>=97&&i<=122||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=55296&&i<=56319||i>=56320&&i<=57343||(o||n)&&BD(a)))return r.length?{token:String.fromCharCode(...r),offset:s}:null;o||(o=!0),r.push(a)}var i}function VD(e,t){for(let i=!1,o=0;;o++){let r=e.peek(t+o);if(n=r,!PD.includes(n))return i?{token:" ",offset:o}:null;i||(i=!0)}var n}const FD={[VP]:"identifier",[FP]:"nameIdentifier"},zD=new kP(((e,t)=>{MD&&console.log("%s: T <identifier | nameIdentifier>",e.pos);const n=function(e,t){const n=t.contextKeys(),i=t.tokens;for(let t=0,o=[],r=null;;){const s=i.length+o.length>0,a=o.length>0,l=qD(e,t,s)||s&&ND(e,t)||a&&VD(e,t);if(!l)return r;const{token:c,offset:u}=l;if(t+=u," "===c)continue;o=[...o,c];const h=[...i,...o].join(" ");if(n.some((e=>e===h))){const e=o[0];r={token:e,offset:e.length,term:123}}if(!n.some((e=>e.startsWith(h)))){if(GD.some((e=>e===h))){const e=o[0];r={token:e,offset:e.length,term:122}}if(!GD.some((e=>e.startsWith(h))))return r}}}(e,t.context),i=t.context.tokens,o=n||qD(e,0,i.length>0);o&&(e.advance(o.offset),e.acceptToken(n?n.term:122),TD&&console.log("%s: MATCH <%s> <%s>",e.pos,n?FD[n.term]:"identifier",o.token))}),{contextual:!0}),QD=new kP(((e,t)=>{MD&&console.log("%s: T <propertyIdentifier>",e.pos);const n=qD(e,0,t.context.tokens.length>0);n&&(e.advance(n.offset),e.acceptToken(121),TD&&console.log("%s: MATCH <propertyIdentifier> <%s>",e.pos,n.token))})),HD=new kP(((e,t)=>{let n;MD&&console.log("%s: T <insertSemi>",e.pos);let i=!1;for(n=0;;n++){const t=e.peek(n);if(!PD.includes(t)){DD.includes(t)&&(i=!0);break}}if(i){const t=qD(e,n+1);if(VD(e,n+1)||t&&/^(then|else|return|satisfies)$/.test(t.token))return;TD&&console.log("%s: MATCH <insertSemi>",e.pos),e.acceptToken(124)}})),WD={[fD]:"FunctionInvocation",[dD]:"FilterExpression",[uD]:"PathExpression"},UD={[kD]:"Context",[CD]:"FunctionDefinition",[HP]:"ForExpression",[bD]:"List",[ZP]:"IfExpression",[eD]:"QuantifiedExpression"},XD={[OD]:"Context",[wD]:"FunctionDefinition",[QP]:"ForExpression",[_D]:"List",[YP]:"IfExpression",[JP]:"QuantifiedExpression",[cD]:"PathExpression",[pD]:"FunctionInvocation",[hD]:"FilterExpression",[iD]:"ArithmeticExpression"};class KD{constructor(e){this.fn=e}get(e){return this.fn(e)}static of(e){return new KD(e)}}const GD=Object.keys({"date and time":1,date:1,time:1,duration:1});class YD{constructor(e={}){this.value=e}getKeys(){return Object.keys(this.value)}get(e){const t=this.value[e],n=this.constructor;return n.isAtomic(t)?t:n.of(t)}set(e,t){return this.constructor.of({...this.value,[e]:t})}merge(e){const t=this.constructor;return new t(t.__merge(this.value,e))}static isAtomic(e){return!e||e instanceof this||e instanceof KD||"object"!=typeof e}static of(...e){return e.reduce(((e,t)=>e.merge(t)),new this({}))}static __unwrap(e){return e?e instanceof this?e.value:"object"!=typeof e?{}:{...e}:{}}static __merge(e,t){return f(this.__unwrap(t),((e,t,n)=>t instanceof KD?{...e,[n]:t}:(t=this.__unwrap(t),u(e,n)&&(t=this.__merge(this.__unwrap(e[n]),t)),{...e,[n]:t})),this.__unwrap(e))}}class ZD{constructor({name:e="Expressions",tokens:t=[],children:n=[],parent:i=null,context:o,value:r,raw:s}){this.name=e,this.tokens=t,this.children=n,this.parent=i,this.context=o,this.value=r,this.raw=s}enterScope(e){const t=this.of({name:e,parent:this});return AD&&console.log("[%s] enter",t.path,t.context),t}exitScope(e){return this.parent?(AD&&console.log("[%s] exit %o\n%s",this.path,this.context,LD(e," ")),this.parent.pushChild(this)):(AD&&console.log("[%s] NO exit %o\n%s",this.path,this.context,LD(e," ")),this)}token(e){return AD&&console.log("[%s] token <%s> + <%s>",this.path,this.tokens.join(" "),e),this.assign({tokens:[...this.tokens,e]})}literal(e){return AD&&console.log("[%s] literal %o",this.path,e),this.pushChild(this.of({name:"Literal",value:e}))}computedValue(){for(let e=this;;e=i$(e.children)){if(!e)return null;if(e.value)return e.value}}contextKeys(){return this.context.getKeys().map(JD)}get path(){return this.parent?.path?.concat(" > ",this.name)||this.name}get(e){const t=[e,e&&JD(e)],n=this.context.getKeys().find((e=>t.includes(JD(e))));if(void 0===n)return;const i=this.context.get(n);return i instanceof KD?i.get(this):i}resolveName(){const e=this.tokens.join(" "),t=this.assign({tokens:[]}),n=this.of({name:"VariableName",parent:t,value:this.get(e),raw:e});return AD&&console.log("[%s] resolve name <%s=%s>",n.path,e,this.get(e)),t.pushChild(n)}pushChild(e){if(!e)return this;const t=this.assign({children:[...this.children,e]});return e.parent=t,t}pushChildren(e){let t=this;for(const n of e)t=t.pushChild(n);return t}declareName(){if(0===this.tokens.length)throw Error("no tokens to declare name");const e=this.tokens.join(" ");return AD&&console.log("[%s] declareName <%s>",this.path,e),this.assign({tokens:[]}).pushChild(this.of({name:"Name",value:e}))}define(e,t){if("string"!=typeof e)return AD&&console.log("[%s] no define <%s=%s>",this.path,e,t),this;AD&&console.log("[%s] define <%s=%s>",this.path,e,t);const n=this.context.set(e,t);return this.assign({context:n})}assign(e={}){return ZD.of({...this,...e})}of(e={}){const t={context:this.context,parent:this.parent};return ZD.of({...t,...e})}static of(e){const{name:t,tokens:n=[],children:i=[],parent:o=null,context:r,value:s,raw:a}=e;if(!r)throw new Error("must provide <context>");return new ZD({name:t,tokens:[...n],children:[...i],context:r,parent:o,value:s,raw:a})}}function JD(e){return e.replace(/\s*([./\-'+]|\*\*?)\s*/g," $1 ").replace(/\s{2,}/g," ").trim()}function e$(e,t,n){const i=e.children.filter((e=>e.name!==t)),o=e.children.filter((e=>e.name===t)),r=i[0],s=i[Math.max(1,i.length-1)],a=r?.computedValue(),l=s?.computedValue()||null;return e.assign({children:o}).enterScope(t).pushChildren(i).exitScope(n).define(a,l)}function t$(e={},t=YD){const n=ZD.of({context:t.of(e)});return new BP({start:n,reduce(e,n,i,o){if(n===YP){const[n,i]=e.children.slice(-2);e=e.assign({value:t.of(n?.computedValue(),i?.computedValue())})}if(n===_D&&(e=e.assign({value:t.of(...e.children.map((e=>e?.computedValue())))})),n===hD){const[t,n]=e.children.slice(-2);e=e.assign({value:t?.computedValue()})}if(n===pD){const[t,...n]=e.children;"get value"===t?.raw&&(e=function(e,t){if(!t.length)return e.assign({value:null});"Name"===t[0].name&&(t=function(e,t){const n={};for(let t=0;t<e.length;t+=2){const[i,o]=e.slice(t,t+2);n[i.value]=o}return t.map((e=>n[e]))}(t,["m","key"]));if(2!==t.length)return e.assign({value:null});const[n,i]=t,o=i?.computedValue(),r=n?.computedValue();if(!r||"object"!=typeof r||"string"!=typeof o)return e.assign({value:null});return e.assign({value:[JD(o),o].reduce(((e,t)=>r.get(t)||e),null)})}(e,n))}const r=UD[n];if(r)return e.enterScope(r);const s=WD[n];if(s){const{children:i,context:o}=e,r=i.slice(0,-1),a=i$(i);let l=null;return n===uD&&(l=t.of(a?.computedValue())),n===dD&&(l=t.of(o,a?.computedValue()).set("item",a?.computedValue())),e.assign({children:r}).enterScope(s).pushChild(a).assign({context:l||o})}const a=o.read(o.pos,i.pos);if(XD[n])return e.exitScope(a);if(n===ED){const n=e.children.filter((e=>"ContextEntry"!==e.name)),i=n[0],o=i$(n);return e$(e,"ContextEntry",a).assign({value:t.of(e.value).set(i?.computedValue(),o?.computedValue())})}if(n===WP||n===tD)return e$(e,"InExpression",a);if(n===GP)return e.define("partial",KD.of((e=>i$(e.children)?.computedValue())));if(n===gD){const t=i$(e.children).computedValue();return e.define(t,1)}if(n===oD||n===rD||n===sD){const t=e.children.slice(0,-1),n=i$(e.children);return e.assign({children:t}).enterScope("ArithmeticExpression").pushChild(n)}if(n===aD)return e.enterScope("ArithmeticExpression");if(n===XP||n===KP||n===RD)return e.token(a);if(n===yD)return e.literal(a.replace(/^"|"$/g,""));if(n===xD)return e.literal("true"===a);if(n===vD)return e.literal(parseFloat(a));if(n===mD)return e.literal(null);if(n===lD)return e.resolveName();if(n===UP||n===SD)return e.declareName();if((n===zP||n===nD)&&e.tokens.length>0)throw new Error("uncleared name");if(n===zP){let t=e;for(;t.parent;)t=t.exitScope(a);return t}return e}})}const n$=t$({});function i$(e){return e[e.length-1]}const o$=VS({StringLiteral:lR.string,NumericLiteral:lR.number,BooleanLiteral:lR.bool,"AtLiteral!":lR.special(lR.string),CompareOp:lR.compareOperator,ArithOp:lR.arithmeticOperator,"for if then else some every satisfies between return":lR.controlKeyword,"in instance of and or":lR.operatorKeyword,function:lR.definitionKeyword,as:lR.keyword,"Type/...":lR.typeName,Wildcard:lR.special(lR.variableName),null:lR.null,LineComment:lR.lineComment,BlockComment:lR.blockComment,'VariableName! "?"':lR.variableName,"DateTimeConstructor! SpecialFunctionName!":lR.function(lR.special(lR.variableName)),"List Interval":lR.list,Context:lR.definition(lR.literal),"Name!":lR.definition(lR.variableName),"Key/Name! ContextEntryType/Name!":lR.definition(lR.propertyName),"PathExpression/VariableName!":lR.function(lR.propertyName),"FormalParameter/ParameterName!":lR.function(lR.definition(lR.variableName)),"( )":lR.paren,"[ ]":lR.squareBracket,"{ }":lR.brace,".":lR.derefOperator,", ;":lR.separator,"..":lR.punctuation}),r$={__proto__:null,for:10,in:32,return:36,if:40,then:42,else:44,some:48,every:50,satisfies:56,or:60,and:64,between:72,instance:86,of:89,days:101,time:103,duration:105,years:107,months:109,date:111,list:117,context:123,function:130,null:156,true:330,false:330,"?":170,external:186,not:211},s$=LP.deserialize({version:14,states:"C|O`QYOOO`QYOOO$sQYOOOOQU'#Ce'#CeO$}QYO'#C`O&WQYO'#FQOOQQ'#Ff'#FfO&bQYO'#FfO`QYO'#DVOOQU'#En'#EnO(UQ^O'#D]OOQU'#D^'#D^OOQU'#D]'#D]OOQO'#Fn'#FnO*RQWO'#DvOOQQ'#D}'#D}OOQQ'#EO'#EOOOQQ'#EP'#EPO*WOWO'#ESO*RQWO'#EQOOQQ'#EQ'#EQOOQQ'#Ft'#FtOOQQ'#Fr'#FrOOQQ'#Fy'#FyOOQQ'#EU'#EUO`QYO'#EWOOQQ'#FS'#FSO*]Q^O'#FSO,SQYO'#EXO,ZQWO'#EYOOQP'#F}'#F}O,`QXO'#EaOOQQ'#Fz'#FzOOQQ'#FR'#FRQOQWOOOOQQ'#FT'#FTOOQQ'#F^'#F^O`QYO'#CoOOQQ'#F_'#F_O$}QYO'#CsO,kQYO'#DwOOQQ'#Fs'#FsO,pQYO'#EROOQO'#ER'#ERO`QYO'#EVO`QYO'#EUOOQO'#F{'#F{Q,xQWOOO,}QYO'#DRO-tQWO'#FbOOQO'#DT'#DTO.PQYO'#FfO.WQWOOO.}QYO'#CdO/[QYO'#FVOOQ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z%^%_%b%e%o%w%{&^!mWOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%zR&V%mT&Z%n&t!a!eT!Q!n!t!v#P#X#Y#i#j#k#l#n#o#p#q#v$k$o$r%R%S%Z%^%_%b%e%o%w%{&^!a!gT!Q!n!t!v#P#X#Y#i#j#k#l#n#o#p#q#v$k$o$r%R%S%Z%^%_%b%e%o%w%{&^!m^OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%zQ!q^R!scR#z!pQ!wlR#{!p!mfOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%z!mlOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%z!mmOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%zR$U!x!moOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Z#]#_#c#g#r$O$P$Y$^$_$b$q$}%X%d%y%zR#Oo",nodeNames:"⚠ LineComment BlockComment Expression ForExpression for InExpressions InExpression Name Identifier Identifier ArithOp ArithOp ArithOp ArithOp ArithOp in IterationContext return IfExpression if then else QuantifiedExpression some every InExpressions InExpression satisfies Disjunction or Conjunction and Comparison CompareOp CompareOp between PositiveUnaryTest ( PositiveUnaryTests ) ArithmeticExpression InstanceOfExpression instance of Type QualifiedName VariableName BacktickIdentifier SpecialType days time duration years months date > ListType list < ContextType context ContextEntryTypes ContextEntryType FunctionType function ArgumentTypes ArgumentType PathExpression ] FilterExpression [ FunctionInvocation SpecialFunctionName NamedParameters NamedParameter ParameterName PositionalParameters null NumericLiteral StringLiteral BooleanLiteral DateTimeLiteral DateTimeConstructor AtLiteral ? SimplePositiveUnaryTest Interval ParenthesizedExpression List FunctionDefinition FormalParameters FormalParameter external FunctionBody } { Context ContextEntry Key Name Identifier Expressions UnaryTests Wildcard not",maxTerm:173,context:n$,nodeProps:[["group",-17,4,19,23,29,31,33,41,42,68,70,72,85,86,88,89,90,97,"Expr",47,"Expr Expr",-5,78,79,80,81,82,"Expr Literal"],["closedBy",38,")",71,"]",96,"}"],["openedBy",40,"(",69,"[",95,"{"]],propSources:[o$],skippedNodes:[0,1,2],repeatNodeCount:14,tokenData:".Z~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx&fxy&kyz&pz{&u{|'S|}'X}!O'^!O!P'k!P!Q(u!Q![*p![!]+X!]!^+^!^!_+c!_!`$i!`!a+r!b!c+|!}#O,R#P#Q,W#Q#R&}#S#T,]#o#p.P#q#r.U$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#r~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#s~~$fP!_!`$i~$nOr~~$sW$j~OY$nZr$nrs%]s#O$n#O#P%b#P;'S$n;'S;=`&`<%lO$n~%bO$j~~%eRO;'S$n;'S;=`%n;=`O$n~%sX$j~OY$nZr$nrs%]s#O$n#O#P%b#P;'S$n;'S;=`&`;=`<%l$n<%lO$n~&cP;=`<%l$n~&kO#{~~&pOv~~&uOx~~&zP^~z{&}~'SO_~~'XO[~~'^O$O~R'cPZP!`!a'fQ'kO$_Q~'pQ#z~!O!P'v!Q!['{~'{O#}~~(QR$i~!Q!['{!g!h(Z#X#Y(Z~(^R{|(g}!O(g!Q![(m~(jP!Q![(m~(rP$i~!Q![(m~(zQ]~z{)Q!P!Q*X~)TTOz)Qz{)d{;'S)Q;'S;=`*R<%lO)Q~)gVOz)Qz{)d{!P)Q!P!Q)|!Q;'S)Q;'S;=`*R<%lO)Q~*ROQ~~*UP;=`<%l)Q~*^SP~OY*XZ;'S*X;'S;=`*j<%lO*X~*mP;=`<%l*X~*uS$i~!O!P+R!Q![*p!g!h(Z#X#Y(Z~+UP!Q!['{~+^O$]~~+cO$s~R+jP!]QsP!_!`+mP+rOsPR+yP!YQsP!_!`+m~,RO$l~~,WO!i~~,]O!g~~,`WOY,]Z#O,]#O#P,x#P#S,]#S#T-t#T;'S,];'S;=`-y<%lO,]~,{RO;'S,];'S;=`-U;=`O,]~-XXOY,]Z#O,]#O#P,x#P#S,]#S#T-t#T;'S,];'S;=`-y;=`<%l,]<%lO,]~-yO$Z~~-|P;=`<%l,]~.UO#S~~.ZO#R~",tokenizers:[QD,zD,HD,0,1],topRules:{Expression:[0,3],Expressions:[1,102],UnaryTests:[2,103]},dialects:{camunda:2544},dynamicPrecedences:{31:-1,68:1,72:-1,74:-1},specialized:[{term:122,get:e=>r$[e]||-1}],tokenPrec:2546});function a$(e){const t=[];return e.iterate({enter:e=>{const n=e.node;if(!n.type.isError)return;const i=n.parent,o=l$(n),r={from:n.from,to:n.to,severity:"error",type:"Syntax Error"};if(n.from!==n.to)r.message=`Unrecognized token in <${i.name}>`;else if(o)r.message=`Unrecognized token <${o.name}> in <${i.name}>`,r.to=o.to;else{const e=i.enterUnfinishedNodesBefore(n.to);r.message=`Incomplete <${(e||i).name}>`}t.push(r)}}),t}function l$(e){return e?e.nextSibling||l$(e.parent):null}var c$={create:e=>({enter(t){if("FilterExpression"!==t.name)return;const n=e.readContent(t.from,t.to);if(/\[\s*0\s*\]$/.test(n)){const{from:i,to:o}=t;e.report({from:i,to:o,message:"First item is accessed via [1]",severity:"warning",type:"first-item",actions:[{name:"fix",apply(t,r=i,s=o){e.updateContent(r,s,n.replace(/\[\s*0\s*\]$/,"[1]"))}}]})}}})};const u$=[c$];function h$(e){const{readContent:t,syntaxTree:n,updateContent:i}=e,o=[],r={readContent:t,report:e=>{o.push(e)},updateContent:i},s=u$.map((e=>e.create(r)));return n.iterate({enter:e=>{for(const t of s)t.enter&&t.enter(e)},leave:e=>{for(const t of s)t.leave&&t.leave(e)}}),o}const d$=[bM("function(${params}) ${body}",{label:"function",detail:"definition",type:"keyword"}),bM("for ${var} in ${collection} return ${value}",{label:"for",detail:"expression",type:"keyword"}),bM("every ${var} in ${collection} satisfies ${condition}",{label:"every",detail:"quantified expression",type:"keyword"}),bM("some ${var} in ${collection} satisfies ${condition}",{label:"some",detail:"quantified expression",type:"keyword"}),bM("if ${condition} then ${value} else ${other value}",{label:"if",detail:"block",type:"keyword"}),bM("{ ${key}: ${value} }",{label:"context",detail:"block",type:"keyword"}),bM("null",{label:"null",detail:"literal",type:"keyword"}),bM("true",{label:"true",detail:"literal",type:"keyword"}),bM("false",{label:"false",detail:"literal",type:"keyword"})];function p$(){return p$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p$.apply(this,arguments)}function f$(e){const{context:t,after:n,before:i,keyword:o}=e;return function(e,t){const{nodes:n,before:i,after:o,keyword:r}=e;return e=>{const{state:s,pos:a}=e,l=_$(gR(s).resolveInner(a,-1),n);if(!l)return null;const[c]=l;return x$(c,a,[r,i])||function(e,t,n){return b$(e,t,n,1)}(c,a,[r,o])||o&&!x$(c,a,[o])?null:t(e)}}({nodes:t,before:i,after:n,keyword:o},bT([{label:o,type:"keyword",boost:10}]))}const g$=[f$({context:"InExpression",keyword:"in"}),f$({context:"IfExpression",keyword:"then",after:"if",before:"else"}),f$({context:"IfExpression",keyword:"else",after:"then"}),f$({context:"QuantifiedExpression",keyword:"satisfies"}),f$({context:"ForExpression",after:"InExpressions",keyword:"return"})],m$=["StringLiteral","Identifier","LineComment","BlockComment","PathExpression","Context","Key","ParameterName"],v$=["Expr","ContextEntry"];function y$(e){return function(e){const t=[...m$,...v$];return n=>{const{state:i,pos:o}=n,r=_$(gR(i).resolveInner(o,-1),t);if(r){const[e,t]=r;if(m$.includes(t))return null}return e(n)}}(bT(e.map((e=>p$({},e,{type:"text"})))))}function x$(e,t,n){return b$(e,t,n,-1)}function b$(e,t,n,i){let o=e[i>0?"childAfter":"childBefore"](t);for(;o;){if(n.includes(o.name))return o;if(o.type.isError&&o.firstChild&&n.includes(o.firstChild.name))return o.firstChild;o=o[i>0?"nextSibling":"prevSibling"]}return null}function _$(e,t){for(Array.isArray(t)||(t=[t]);e;e=e.parent){const n=e.type,i=t.find((e=>e&&n.is(e)));if(i)return[e,i];if(n.isTop)break}return null}const w$=fR.define({parser:s$.configure({props:[PR.add({Context:LR({closing:"}"}),"List FilterExpression":LR({closing:"]"}),"ParenthesizedExpression FunctionInvocation":qR({except:/^\s*\)/}),"ForExpression QuantifiedExpression IfExpression":qR({except:/^\s*(then|else|return|satisfies)\b/}),FunctionDefinition:qR({except:/^\s*(\(|\))/})}),FR.add({Context:zR,List:zR,ParenthesizedExpression:zR,FunctionDefinition(e){const t=e.getChild(")");return t?{from:t.to,to:e.to}:null}})]}),languageData:{indentOnInput:/^\s*(\)|\}|\]|then|else|return|satisfies)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}}),C$=w$.configure({top:"UnaryTests"},"FEEL unary tests"),O$=w$.configure({top:"Expression"},"FEEL expression");var k$=[function(e,t={}){return[rP.of({source:e,config:t}),oP,gP]}((e=>{if(0===e.state.doc.length)return[];const t=gR(e.state),n=(i={syntaxTree:t,readContent:(t,n)=>e.state.sliceDoc(t,n),updateContent:(t,n,i)=>e.dispatch({changes:{from:t,to:n,insert:i}})},[...a$(i.syntaxTree),...h$(i)]);var i;return n.map((e=>({...e,source:e.type})))}))];var E$=[xE.theme({"& .cm-content":{padding:"0px"},"& .cm-line":{padding:"0px"},"&.cm-editor.cm-focused":{outline:"none"},"& .cm-completionInfo":{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis"},"&.cm-editor":{height:"100%"},"& .cm-completionInfo > *":{whiteSpace:"normal"},"& .cm-completionInfo ul":{margin:0,paddingLeft:"15px"},"& .cm-completionInfo pre":{marginBottom:0,whiteSpace:"pre-wrap"},"& .cm-completionInfo p":{marginTop:0},"& .cm-completionInfo p:not(:last-of-type)":{marginBottom:0}}),xE.baseTheme({"& .variableName":{color:"#10f"},"& .number":{color:"#164"},"& .string":{color:"#a11"},"& .bool":{color:"#219"},"& .function":{color:"#aa3731",fontWeight:"bold"},"& .control":{color:"#708"}}),function(e,t){let n,i=[KR];return e instanceof QR&&(e.module&&i.push(xE.styleModule.of(e.module)),n=e.themeType),n?i.push(HR.computeN([xE.darkTheme],(t=>t.facet(xE.darkTheme)==("dark"==n)?[e]:[]))):i.push(HR.of(e)),i}(QR.define([{tag:lR.variableName,class:"variableName"},{tag:lR.name,class:"variableName"},{tag:lR.number,class:"number"},{tag:lR.string,class:"string"},{tag:lR.bool,class:"bool"},{tag:lR.function(lR.variableName),class:"function"},{tag:lR.function(lR.special(lR.variableName)),class:"function"},{tag:lR.controlKeyword,class:"control"},{tag:lR.operatorKeyword,class:"control"}]))];function S$(e){return e&&e.from===e.to}function R$(e){return!!e&&("PathExpression"===e.name||R$(e.parent))}function T$({variables:e}){return t=>{const n=gR(t.state).resolve(t.pos,-1);if(!R$(n))return;const i=function(e){for(;e;){if("PathExpression"===e.name)return e;e=e.parent}}(n),o=n===i?t.pos:n.from,r=M$(i,t);let s=e;for(var a=0;a<r.length-1;a++){var l=s.find((e=>e.name===r[a].name));if(!l)return null;if("optional"!==l.isList&&!!l.isList!==r[a].isList)return;s=l.entries}if(!s)return;s=s.map((e=>({label:e.name,type:"variable",info:e.info,detail:e.detail})));return{from:o,options:s}}}function M$(e,t){let n=[];for(let i=e.firstChild;i;i=i.nextSibling)"PathExpression"===i.name?n.push(...M$(i,t)):"FilterExpression"===i.name?n.push(...A$(i,t)):n.push({name:P$(i,t),isList:!1});return n}function A$(e,t){const n=e.firstChild;if("PathExpression"===n.name){const e=M$(n,t);return e[e.length-1].isList=!0,e}return[{name:P$(n,t),isList:!0}]}function P$(e,t){return t.state.sliceDoc(e.from,e.to)}function D$({variables:e=[],builtins:t=[]}){const n=function(e,t){return[].concat(e.map((e=>$$(e))),t.map((e=>$$(e))))}(e,t);return n.length?e=>{const{pos:t,state:i}=e,o=gR(i).resolve(t,-1);return function(e,t){const n=e.nextSibling;return S$(e)||n&&n.from===t&&S$(n)}(o,t)?e.explicit?{from:t,options:n}:null:!function(e){return e&&e.parent&&"VariableName"===e.parent.name}(o)||R$(o)?null:{from:o.from,options:n}}:e=>null}function $$(e,t){return"function"===e.type?function(e,t){const{name:n,info:i,detail:o,params:r=[]}=e,s=r.map((({name:e,type:t},n)=>({name:e||`param ${n+1}`,type:t}))),a=`${n}(${s.map((e=>"${"+e.name+"}")).join(", ")})`,l=s.map((({name:e,type:t})=>t?`${e}: ${t}`:e)).join(", "),c=`${n}(${l})`;return bM(a,{label:c,type:"function",info:i,detail:o,boost:t})}(e,t):{label:e.name,type:"variable",info:e.info,detail:e.detail,boost:t}}function j$({variables:e=[],builtins:t=[]}){return[T$({variables:e}),D$({variables:e,builtins:t}),y$(d$.map((e=>({...e,boost:-1})))),...g$]}function I$(e){return function(e={}){const t="unaryTests"===e.dialect?C$:O$,n=e.parserDialect,i=t$(e.context),o=t.configure({contextTracker:i,dialect:n}),r=e.completions||[y$(d$),g$].flat();return new kR(o,[...r.map((e=>o.data.of({autocomplete:e})))])}(e)}const B$=o_.define(),L$=o_.define(),N$=o_.define(),q$=o_.define();function V$({dialect:e="expression",parserDialect:t,variables:n=[],builtins:i=[],completions:o=j$({builtins:i,variables:n})}){const r=function(e){return e.slice().reverse().reduce(((e,t)=>(e[t.name]=()=>{},e)),{})}([...n,...i]);return[N$.of(e),B$.of(i),L$.of(n),q$.of(t),I$({dialect:e,parserDialect:t,context:r,completions:o})]}function F$(e){const{name:t,description:n}=e,i=t.match(/^([\w\s]+)\((.*)\)$/),o=i[1],r=i[2],s=r?r.split(", ").map((e=>({name:e}))):[];return{name:o,type:"function",params:s,info:()=>Gt(`<div class="description">${n}<div>`),boost:0}}const z$=[{name:"not(negand)",description:'<p>Returns the logical negation of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">not(negand: boolean): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">not(true)\n// false\n\nnot(null)\n// null\n</code></pre>\n'},{name:"is defined(value)",description:'<p><em>Camunda Extension</em></p>\n<p>Checks if a given value is not <code>null</code>. If the value is <code>null</code> then the function returns <code>false</code>.\nOtherwise, the function returns <code>true</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is defined(value: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is defined(1)\n// true\n\nis defined(null)\n// false\n\nis defined(x)\n// false - if no variable &quot;x&quot; exists\n\nis defined(x.y)\n// false - if no variable &quot;x&quot; exists or it doesn&#39;t have a property &quot;y&quot;\n</code></pre>\n<p>:::caution Breaking change</p>\n<p>This function worked differently in previous versions. It returned <code>true</code> if the value was <code>null</code>.\nSince this version, the function returns <code>false</code> if the value is <code>null</code>.</p>\n<p>:::</p>\n'},{name:"get or else(value, default)",description:'<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n'},{name:"assert(value, condition)",description:'<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n</code></pre>\n'},{name:"assert(value, condition, cause)",description:'<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any, cause: String)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null, &quot;&#39;x&#39; should not be null&quot;)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error(&#39;x&#39; should not be null) - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0, &quot;&#39;x&#39; should be positive&quot;)\n// 4 - if x is 4\n// error(&#39;x&#39; should be positive) - if x is less than zero\n</code></pre>\n'},{name:"get value(context, key)",description:'<p>Returns the value of the context entry with the given key.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get value(context: context, key: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get value({foo: 123}, &quot;foo&quot;)\n// 123\n\nget value({a: 1}, &quot;b&quot;)\n// null\n</code></pre>\n'},{name:"get value(context, keys)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns the value of the context entry for a context path defined by the given keys.</p>\n<p>If <code>keys</code> contains the keys <code>[k1, k2]</code> then it returns the value at the nested entry <code>k1.k2</code> of the context.</p>\n<p>If <code>keys</code> are empty or the nested entry defined by the keys doesn&#39;t exist in the context, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get value(context: context, keys: list&lt;string&gt;): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get value({x:1, y: {z:0}}, [&quot;y&quot;, &quot;z&quot;])\n// 0\n\nget value({x: {y: {z:0}}}, [&quot;x&quot;, &quot;y&quot;])\n// {z:0}\n\nget value({a: {b: 3}}, [&quot;b&quot;])\n// null\n</code></pre>\n'},{name:"get entries(context)",description:'<p>Returns the entries of the context as a list of key-value-pairs.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get entries(context: context): list&lt;context&gt;\n</code></pre>\n<p>The return value is a list of contexts. Each context contains two entries for &quot;key&quot; and &quot;value&quot;.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get entries({foo: 123})\n// [{key: &quot;foo&quot;, value: 123}]\n</code></pre>\n'},{name:"context put(context, key, value)",description:'<p>Adds a new entry with the given key and value to the context. Returns a new context that includes the entry.</p>\n<p>If an entry for the same key already exists in the context, it overrides the value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context put(context: context, key: string, value: Any): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context put({x:1}, &quot;y&quot;, 2)\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context put()</code> replaced the previous function <code>put()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n'},{name:"context put(context, keys, value)",description:'<p>Adds a new entry with the given value to the context. The path of the entry is defined by the keys. Returns a new context that includes the entry.</p>\n<p>If <code>keys</code> contains the keys <code>[k1, k2]</code> then it adds the nested entry <code>k1.k2 = value</code> to the context.</p>\n<p>If an entry for the same keys already exists in the context, it overrides the value.</p>\n<p>If <code>keys</code> are empty, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context put(context: context, keys: list&lt;string&gt;, value: Any): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context put({x:1}, [&quot;y&quot;], 2)\n// {x:1, y:2}\n\ncontext put({x:1, y: {z:0}}, [&quot;y&quot;, &quot;z&quot;], 2)\n// {x:1, y: {z:2}}\n\ncontext put({x:1}, [&quot;y&quot;, &quot;z&quot;], 2)\n// {x:1, y: {z:2}}\n</code></pre>\n'},{name:"context merge(contexts)",description:'<p>Union the given contexts. Returns a new context that includes all entries of the given contexts.</p>\n<p>If an entry for the same key already exists in a context, it overrides the value. The entries are overridden in the same order as in the list of contexts.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context merge(contexts: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context merge([{x:1}, {y:2}])\n// {x:1, y:2}\n\ncontext merge([{x:1, y: 0}, {y:2}])\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context merge()</code> replaced the previous function <code>put all()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n'},{name:"string(from)",description:'<p>Returns the given value as a string representation.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string(from: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string(1.1)\n// &quot;1.1&quot;\n\nstring(date(&quot;2012-12-25&quot;))\n// &quot;2012-12-25&quot;\n</code></pre>\n'},{name:"number(from)",description:'<p>Parses the given string to a number.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">number(&quot;1500.5&quot;)\n// 1500.5\n</code></pre>\n'},{name:"context(entries)",description:'<p>Constructs a context of the given list of key-value pairs. It is the reverse function to <a href="feel-built-in-functions-context.md#get-entriescontext">get entries()</a>.</p>\n<p>Each key-value pair must be a context with two entries: <code>key</code> and <code>value</code>. The entry with name <code>key</code> must have a value of the type <code>string</code>.</p>\n<p>It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.</p>\n<p>Returns <code>null</code> if one of the entries is not a context or if a context doesn&#39;t contain the required entries.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context(entries: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context([{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}])\n// {a:1, b:2}\n</code></pre>\n'},{name:"date(from)",description:'<p>Returns a date from the given value.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31&quot;</code> is invalid because June has\nonly 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class="language-feel">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date(&quot;2018-04-29&quot;)\n// date(&quot;2018-04-29&quot;)\n\ndate(date and time(&quot;2012-12-25T11:00:00&quot;))\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n'},{name:"date(year, month, day)",description:'<p>Returns a date from the given components.</p>\n<p>Returns <code>null</code> if the components don&#39;t represent a valid calendar date. For example, <code>2024,6,31</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date(2012, 12, 25)\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n'},{name:"time(from)",description:'<p>Returns a time from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(from: string): time\n</code></pre>\n<p>Parses the given string into a time.</p>\n<pre><code class="language-feel">time(from: date and time): time\n</code></pre>\n<p>Extracts the time component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(&quot;12:00:00&quot;)\n// time(&quot;12:00:00&quot;)\n\ntime(date and time(&quot;2012-12-25T11:00:00&quot;))\n// time(&quot;11:00:00&quot;)\n</code></pre>\n'},{name:"time(hour, minute, second)",description:'<p>Returns a time from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(hour: number, minute: number, second: number): time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(23, 59, 0)\n// time(&quot;23:59:00&quot;)\n</code></pre>\n'},{name:"time(hour, minute, second, offset)",description:'<p>Returns a time from the given components, including a timezone offset.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(hour: number, minute: number, second: number, offset: days and time duration): time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(14, 30, 0, duration(&quot;PT1H&quot;))\n// time(&quot;14:30:00+01:00&quot;)\n</code></pre>\n'},{name:"date and time(from)",description:'<p>Parses the given string into a date and time.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31T10:00:00&quot;</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(&quot;2018-04-29T09:30:00&quot;)\n// date and time(&quot;2018-04-29T09:30:00&quot;)\n</code></pre>\n'},{name:"date and time(date, time)",description:'<p>Returns a date and time from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(date: date, time: time): date and time\n</code></pre>\n<pre><code class="language-feel">date and time(date: date and time, time: time): date and time\n</code></pre>\n<p>Returns a date and time value that consists of the date component of <code>date</code> combined with <code>time</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(date(&quot;2012-12-24&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-24T23:59:00&quot;)\n\ndate and time(date and time(&quot;2012-12-25T11:00:00&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-25T23:59:00&quot;)\n</code></pre>\n'},{name:"date and time(date, timezone)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns the given date and time value at the given timezone.</p>\n<p>If <code>date</code> has a different timezone than <code>timezone</code> then it adjusts the time to match the local time of <code>timezone</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(date: date and time, timezone: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(@&quot;2020-07-31T14:27:30@Europe/Berlin&quot;, &quot;America/Los_Angeles&quot;)\n// date and time(&quot;2020-07-31T05:27:30@America/Los_Angeles&quot;)\n\ndate and time(@&quot;2020-07-31T14:27:30&quot;, &quot;Z&quot;)\n// date and time(&quot;2020-07-31T12:27:30Z&quot;)\n</code></pre>\n'},{name:"duration(from)",description:'<p>Parses the given string into a duration. The duration is either a days and time duration or a years and months duration.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duration(from: string): days and time duration\n</code></pre>\n<pre><code class="language-feel">duration(from: string): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duration(&quot;P5D&quot;)\n// duration(&quot;P5D&quot;)\n\nduration(&quot;P32Y&quot;)\n// duration(&quot;P32Y&quot;)\n</code></pre>\n'},{name:"years and months duration(from, to)",description:'<p>Returns the years and months duration between <code>from</code> and <code>to</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">years and months duration(from: date, to: date): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">years and months duration(date(&quot;2011-12-22&quot;), date(&quot;2013-08-24&quot;))\n// duration(&quot;P1Y8M&quot;)\n</code></pre>\n'},{name:"list contains(list, element)",description:'<p>Returns <code>true</code> if the given list contains the element. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">list contains(list: list, element: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">list contains([1,2,3], 2)\n// true\n</code></pre>\n'},{name:"count(list)",description:'<p>Returns the number of elements of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">count(list: list): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">count([1,2,3])\n// 3\n</code></pre>\n'},{name:"min(list)",description:'<p>Returns the minimum of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">min(list: list): Any\n</code></pre>\n<p>All elements in <code>list</code> should have the same type and be comparable.</p>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">min([1,2,3])\n// 1\n\nmin(1,2,3)\n// 1\n</code></pre>\n'},{name:"max(list)",description:'<p>Returns the maximum of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">max(list: list): Any\n</code></pre>\n<p>All elements in <code>list</code> should have the same type and be comparable.</p>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">max([1,2,3])\n// 3\n\nmax(1,2,3)\n// 3\n</code></pre>\n'},{name:"sum(list)",description:'<p>Returns the sum of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sum(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sum([1,2,3])\n// 6\n\nsum(1,2,3)\n// 6\n</code></pre>\n'},{name:"product(list)",description:'<p>Returns the product of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">product(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">product([2, 3, 4])\n// 24\n\nproduct(2, 3, 4)\n// 24\n</code></pre>\n'},{name:"mean(list)",description:'<p>Returns the arithmetic mean (i.e. average) of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">mean(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">mean([1,2,3])\n// 2\n\nmean(1,2,3)\n// 2\n</code></pre>\n'},{name:"median(list)",description:'<p>Returns the median element of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">median(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">median(8, 2, 5, 3, 4)\n// 4\n\nmedian([6, 1, 2, 3])\n// 2.5\n</code></pre>\n'},{name:"stddev(list)",description:'<p>Returns the standard deviation of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">stddev(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">stddev(2, 4, 7, 5)\n// 2.0816659994661326\n\nstddev([2, 4, 7, 5])\n// 2.0816659994661326\n</code></pre>\n'},{name:"mode(list)",description:'<p>Returns the mode of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">mode(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">mode(6, 3, 9, 6, 6)\n// [6]\n\nmode([6, 1, 9, 6, 1])\n// [1, 6]\n</code></pre>\n'},{name:"all(list)",description:'<p>Returns <code>false</code> if any element of the given list is <code>false</code>. Otherwise, returns <code>true</code>.</p>\n<p>If the given list is empty, it returns <code>true</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">all(list: list&lt;boolean&gt;): boolean\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">all([true,false])\n// false\n\nall(false,null,true)\n// false\n</code></pre>\n<p>:::info\nThe function <code>all()</code> replaced the previous function <code>and()</code>. The previous function is deprecated and\nshould not be used anymore.\n:::</p>\n'},{name:"any(list)",description:'<p>Returns <code>true</code> if any element of the given list is <code>true</code>. Otherwise, returns <code>false</code>.</p>\n<p>If the given list is empty, it returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">any(list: list&lt;boolean&gt;): boolean\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">any([false,true])\n// true\n\nany(false,null,true)\n// true\n</code></pre>\n<p>:::info\nThe function <code>any()</code> replaced the previous function <code>or()</code>. The previous function is deprecated and\nshould not be used anymore.\n:::</p>\n'},{name:"sublist(list, start position)",description:'<p>Returns a partial list of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sublist(list: list, start position: number): list\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sublist([1,2,3], 2)\n// [2,3]\n</code></pre>\n'},{name:"sublist(list, start position, length)",description:'<p>Returns a partial list of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sublist(list: list, start position: number, length: number): list\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sublist([1,2,3], 1, 2)\n// [1,2]\n</code></pre>\n'},{name:"append(list, items)",description:'<p>Returns the given list with all <code>items</code> appended.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">append(list: list, items: Any): list\n</code></pre>\n<p>The parameter <code>items</code> can be a single element or a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">append([1], 2, 3)\n// [1,2,3]\n</code></pre>\n'},{name:"concatenate(lists)",description:'<p>Returns a list that includes all elements of the given lists.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">concatenate(lists: list): list\n</code></pre>\n<p>The parameter <code>lists</code> is a sequence of lists.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">concatenate([1,2],[3])\n// [1,2,3]\n\nconcatenate([1],[2],[3])\n// [1,2,3]\n</code></pre>\n'},{name:"insert before(list, position, newItem)",description:'<p>Returns the given list with <code>newItem</code> inserted at <code>position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">insert before(list: list, position: number, newItem: Any): list\n</code></pre>\n<p>The <code>position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">insert before([1,3],1,2)\n// [2,1,3]\n</code></pre>\n'},{name:"remove(list, position)",description:'<p>Returns the given list without the element at <code>position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">remove(list: list, position: number): list\n</code></pre>\n<p>The <code>position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">remove([1,2,3], 2)\n// [1,3]\n</code></pre>\n'},{name:"reverse(list)",description:'<p>Returns the given list in revered order.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">reverse(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">reverse([1,2,3])\n// [3,2,1]\n</code></pre>\n'},{name:"index of(list, match)",description:'<p>Returns an ascending list of positions containing <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">index of(list: list, match: Any): list&lt;number&gt;\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">index of([1,2,3,2],2)\n// [2,4]\n</code></pre>\n'},{name:"union(list)",description:'<p>Returns a list that includes all elements of the given lists without duplicates.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">union(list: list): list\n</code></pre>\n<p>The parameter <code>list</code> is a sequence of lists.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">union([1,2],[2,3])\n// [1,2,3]\n</code></pre>\n'},{name:"distinct values(list)",description:'<p>Returns the given list without duplicates.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">distinct values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">distinct values([1,2,3,2,1])\n// [1,2,3]\n</code></pre>\n'},{name:"duplicate values(list)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns all duplicate values of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duplicate values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duplicate values([1,2,3,2,1])\n// [1,2]\n</code></pre>\n'},{name:"flatten(list)",description:'<p>Returns a list that includes all elements of the given list without nested lists.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">flatten(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">flatten([[1,2],[[3]], 4])\n// [1,2,3,4]\n</code></pre>\n'},{name:"sort(list, precedes)",description:'<p>Returns the given list sorted by the <code>precedes</code> function.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sort(list: list, precedes: function&lt;(Any, Any) -&gt; boolean&gt;): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sort(list: [3,1,4,5,2], precedes: function(x,y) x &lt; y)\n// [1,2,3,4,5]\n</code></pre>\n'},{name:"string join(list)",description:'<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;])\n// &quot;abc&quot;\n\nstring join([&quot;a&quot;,null,&quot;c&quot;])\n// &quot;ac&quot;\n\nstring join([])\n// &quot;&quot;\n</code></pre>\n'},{name:"string join(list, delimiter)",description:'<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string contains a <code>delimiter</code> between each element.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;, delimiter: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;], &quot;X&quot;)\n// &quot;a&quot;\n\nstring join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;], &quot;, &quot;)\n// &quot;a, b, c&quot;\n</code></pre>\n'},{name:"string join(list, delimiter, prefix, suffix)",description:'<p><em>Camunda Extension</em></p>\n<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string starts with <code>prefix</code>, contains a <code>delimiter</code> between each element, and ends\nwith <code>suffix</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;, delimiter: string, prefix: string, suffix: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;], &quot;, &quot;, &quot;[&quot;, &quot;]&quot;)\n// &quot;[a, b, c]&quot;\n</code></pre>\n'},{name:"is empty(list)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n'},{name:"partition(list, size)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n'},{name:"decimal(n, scale)",description:'<p>Rounds the given value at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">decimal(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n</code></pre>\n'},{name:"floor(n)",description:'<p>Rounds the given value with rounding mode flooring.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">floor(n: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">floor(1.5)\n// 1\n\nfloor(-1.5)\n// -2\n</code></pre>\n'},{name:"floor(n, scale)",description:'<p>Rounds the given value with rounding mode flooring at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">floor(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">floor(-1.56, 1)\n// -1.6\n</code></pre>\n'},{name:"ceiling(n)",description:'<p>Rounds the given value with rounding mode ceiling.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ceiling(n: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ceiling(1.5)\n// 2\n\nceiling(-1.5)\n// -1\n</code></pre>\n'},{name:"ceiling(n, scale)",description:'<p>Rounds the given value with rounding mode ceiling at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ceiling(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ceiling(-1.56, 1)\n// -1.5\n</code></pre>\n'},{name:"round up(n, scale)",description:'<p>Rounds the given value with the rounding mode round-up at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round up(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round up(5.5)\n// 6\n\nround up(-5.5)\n// -6\n\nround up(1.121, 2)\n// 1.13\n\nround up(-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"round down(n, scale)",description:'<p>Rounds the given value with the rounding mode round-down at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round down(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round down(5.5, 0)\n// 5\n\nround down (-5.5, 0)\n// -5\n\nround down (1.121, 2)\n// 1.12\n\nround down (-1.126, 2)\n// -1.12\n</code></pre>\n'},{name:"round half up(n, scale)",description:'<p>Rounds the given value with the rounding mode round-half-up at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round half up(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round half up(5.5, 0)\n// 6\n\nround half up(-5.5, 0)\n// -6\n\nround half up(1.121, 2)\n// 1.12\n\nround half up(-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"round half down(n, scale)",description:'<p>Rounds the given value with the rounding mode round-half-down at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round half down(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round half down (5.5, 0)\n// 5\n\nround half down (-5.5, 0)\n// -5\n\nround half down (1.121, 2)\n// 1.12\n\nround half down (-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"abs(number)",description:'<p>Returns the absolute value of the given numeric value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">abs(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">abs(10)\n// 10\n\nabs(-10)\n// 10\n</code></pre>\n'},{name:"modulo(dividend, divisor)",description:'<p>Returns the remainder of the division of dividend by divisor.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">modulo(dividend: number, divisor: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">modulo(12, 5)\n// 2\n</code></pre>\n'},{name:"sqrt(number)",description:'<p>Returns the square root of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sqrt(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sqrt(16)\n// 4\n</code></pre>\n'},{name:"log(number)",description:'<p>Returns the natural logarithm (base e) of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">log(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">log(10)\n// 2.302585092994046\n</code></pre>\n'},{name:"exp(number)",description:'<p>Returns the Euler’s number e raised to the power of the given number .</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">exp(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">exp(5)\n// 148.4131591025766\n</code></pre>\n'},{name:"odd(number)",description:'<p>Returns <code>true</code> if the given value is odd. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">odd(number: number): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">odd(5)\n// true\n\nodd(2)\n// false\n</code></pre>\n'},{name:"even(number)",description:'<p>Returns <code>true</code> if the given is even. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">even(number: number): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">even(5)\n// false\n\neven(2)\n// true\n</code></pre>\n'},{name:"random number()",description:'<p><em>Camunda Extension</em></p>\n<p>Returns a random number between <code>0</code> and <code>1</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">random number(): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">random number()\n// 0.9701618132579795\n</code></pre>\n'},{name:"before(point1, point2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before(1, 10)\n// true\n\nbefore(10, 1)\n// false\n</code></pre>\n'},{name:"before(range, point)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before([1..5], 10)\n// true\n</code></pre>\n'},{name:"before(point, range)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before(1, [2..5])\n// true\n</code></pre>\n'},{name:"before(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before([1..5], [6..10])\n// true\n\nbefore([1..5),[5..10])\n// true\n</code></pre>\n'},{name:"after(point1, point2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after(10, 1)\n// true\n\nafter(1, 10)\n// false\n</code></pre>\n'},{name:"after(range, point)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after([1..5], 10)\n// false\n</code></pre>\n'},{name:"after(point, range)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after(12, [2..5])\n// true\n</code></pre>\n'},{name:"after(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after([6..10], [1..5])\n// true\n\nafter([5..10], [1..5))\n// true\n</code></pre>\n'},{name:"meets(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">meets(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">meets([1..5], [5..10])\n// true\n\nmeets([1..3], [4..6])\n// false\n\nmeets([1..3], [3..5])\n// true\n\nmeets([1..5], (5..8])\n// false\n</code></pre>\n'},{name:"met by(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">met by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">met by([5..10], [1..5])\n// true\n\nmet by([3..4], [1..2])\n// false\n\nmet by([3..5], [1..3])\n// true\n\nmet by((5..8], [1..5))\n// false\n\nmet by([5..10], [1..5))\n// false\n</code></pre>\n'},{name:"overlaps(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps([5..10], [1..6])\n// true\n\noverlaps((3..7], [1..4])\n// true\n\noverlaps([1..3], (3..6])\n// false\n\noverlaps((5..8], [1..5))\n// false\n\noverlaps([4..10], [1..5))\n// true\n</code></pre>\n'},{name:"overlaps before(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps before(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps before([1..5], [4..10])\n// true\n\noverlaps before([3..4], [1..2])\n// false\n\noverlaps before([1..3], (3..5])\n// false\n\noverlaps before([1..5), (3..8])\n// true\n\noverlaps before([1..5), [5..10])\n// false\n</code></pre>\n'},{name:"overlaps after(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps after(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps after([4..10], [1..5])\n// true\n\noverlaps after([3..4], [1..2])\n// false\n\noverlaps after([3..5], [1..3))\n// false\n\noverlaps after((5..8], [1..5))\n// false\n\noverlaps after([4..10], [1..5))\n// true\n</code></pre>\n'},{name:"finishes(point, range)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finishes(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finishes(5, [1..5])\n// true\n\nfinishes(10, [1..7])\n// false\n</code></pre>\n'},{name:"finishes(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finishes(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finishes([3..5], [1..5])\n// true\n\nfinishes((1..5], [1..5))\n// false\n\nfinishes([5..10], [1..10))\n// false\n</code></pre>\n'},{name:"finished by(range, point)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finished by(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finished by([5..10], 10)\n// true\n\nfinished by([3..4], 2)\n// false\n</code></pre>\n'},{name:"finished by(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finished by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finished by([1..5], [3..5])\n// true\n\nfinished by((5..8], [1..5))\n// false\n\nfinished by([5..10], (1..10))\n// false\n</code></pre>\n'},{name:"includes(range, point)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">includes(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">includes([5..10], 6)\n// true\n\nincludes([3..4], 5)\n// false\n</code></pre>\n'},{name:"includes(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">includes(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">includes([1..10], [4..6])\n// true\n\nincludes((5..8], [1..5))\n// false\n\nincludes([1..10], [1..5))\n// true\n</code></pre>\n'},{name:"during(point, range)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">during(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">during(5, [1..10])\n// true\n\nduring(12, [1..10])\n// false\n\nduring(1, (1..10])\n// false\n</code></pre>\n'},{name:"during(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">during(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">during([4..6], [1..10))\n// true\n\nduring((1..5], (1..10])\n// true\n</code></pre>\n'},{name:"starts(point, range)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts(1, [1..5])\n// true\n\nstarts(1, (1..8])\n// false\n</code></pre>\n'},{name:"starts(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts((1..5], [1..5])\n// false\n\nstarts([1..10], [1..5])\n// false\n\nstarts((1..5), (1..10))\n// true\n</code></pre>\n'},{name:"started by(range, point)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">started by(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">started by([1..10], 1)\n// true\n\nstarted by((1..10], 1)\n// false\n</code></pre>\n'},{name:"started by(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">started by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">started by([1..10], [1..5])\n// true\n\nstarted by((1..10], [1..5))\n// false\n\nstarted by([1..10], [1..10))\n// true\n</code></pre>\n'},{name:"coincides(point1, point2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">coincides(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">coincides(5, 5)\n// true\n\ncoincides(3, 4)\n// false\n</code></pre>\n'},{name:"coincides(range1, range2)",description:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">coincides(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">coincides([1..5], [1..5])\n// true\n\ncoincides((1..5], [1..5))\n// false\n\ncoincides([1..5], [2..6])\n// false\n</code></pre>\n'},{name:"substring(string, start position)",description:'<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring(&quot;foobar&quot;, 3)\n// &quot;obar&quot;\n\nsubstring(&quot;foobar&quot;, -2)\n// &quot;ar&quot;\n</code></pre>\n'},{name:"substring(string, start position, length)",description:'<p>Returns a substring of the given value, starting at <code>start position</code> with the given <code>length</code>. If <code>length</code> is greater than\nthe remaining characters of the value, it returns all characters from <code>start position</code> until the end.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring(&quot;foobar&quot;, 3, 3)\n// &quot;oba&quot;\n\nsubstring(&quot;foobar&quot;, -3, 2)\n// &quot;ba&quot;\n\nsubstring(&quot;foobar&quot;, 3, 10)\n// &quot;obar&quot;\n</code></pre>\n'},{name:"string length(string)",description:'<p>Returns the number of characters in the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string length(string: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string length(&quot;foo&quot;)\n// 3\n</code></pre>\n'},{name:"upper case(string)",description:'<p>Returns the given value with all characters are uppercase.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">upper case(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">upper case(&quot;aBc4&quot;)\n// &quot;ABC4&quot;\n</code></pre>\n'},{name:"lower case(string)",description:'<p>Returns the given value with all characters are lowercase.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">lower case(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">lower case(&quot;aBc4&quot;)\n// &quot;abc4&quot;\n</code></pre>\n'},{name:"substring before(string, match)",description:'<p>Returns a substring of the given value that contains all characters before <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring before(string: string, match: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring before(&quot;foobar&quot;, &quot;bar&quot;)\n// &quot;foo&quot;\n</code></pre>\n'},{name:"substring after(string, match)",description:'<p>Returns a substring of the given value that contains all characters after <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring after(string: string, match: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring after(&quot;foobar&quot;, &quot;ob&quot;)\n// &quot;ar&quot;\n</code></pre>\n'},{name:"contains(string, match)",description:'<p>Returns <code>true</code> if the given value contains the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">contains(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">contains(&quot;foobar&quot;, &quot;of&quot;)\n// false\n</code></pre>\n'},{name:"starts with(string, match)",description:'<p>Returns <code>true</code> if the given value starts with the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts with(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts with(&quot;foobar&quot;, &quot;fo&quot;)\n// true\n</code></pre>\n'},{name:"ends with(string, match)",description:'<p>Returns <code>true</code> if the given value ends with the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ends with(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ends with(&quot;foobar&quot;, &quot;r&quot;)\n// true\n</code></pre>\n'},{name:"matches(input, pattern)",description:'<p>Returns <code>true</code> if the given value matches the <code>pattern</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">matches(input: string, pattern: string): boolean\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">matches(&quot;foobar&quot;, &quot;^fo*bar&quot;)\n// true\n</code></pre>\n'},{name:"matches(input, pattern, flags)",description:'<p>Returns <code>true</code> if the given value matches the <code>pattern</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">matches(input: string, pattern: string, flags: string): boolean\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>flags</code> can contain one or more of the following characters:</p>\n<ul>\n<li><code>s</code> (dot-all)</li>\n<li><code>m</code> (multi-line)</li>\n<li><code>i</code> (case insensitive)</li>\n<li><code>x</code> (comments)</li>\n</ul>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">matches(&quot;FooBar&quot;, &quot;foo&quot;, &quot;i&quot;)\n// true\n</code></pre>\n'},{name:"replace(input, pattern, replacement)",description:'<p>Returns the resulting string after replacing all occurrences of <code>pattern</code> with <code>replacement</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">replace(input: string, pattern: string, replacement: string): string\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>replacement</code> can access the match groups by using <code>$</code> and the number of the group, for example,\n<code>$1</code> to access the first group.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">replace(&quot;abcd&quot;, &quot;(ab)|(a)&quot;, &quot;[1=$1][2=$2]&quot;)\n// &quot;[1=ab][2=]cd&quot;\n\nreplace(&quot;0123456789&quot;, &quot;(\\d{3})(\\d{3})(\\d{4})&quot;, &quot;($1) $2-$3&quot;)\n// &quot;(012) 345-6789&quot;\n</code></pre>\n'},{name:"replace(input, pattern, replacement, flags)",description:'<p>Returns the resulting string after replacing all occurrences of <code>pattern</code> with <code>replacement</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">replace(input: string, pattern: string, replacement: string, flags: string): string\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>replacement</code> can access the match groups by using <code>$</code> and the number of the group, for example,\n<code>$1</code> to access the first group.</p>\n<p>The <code>flags</code> can contain one or more of the following characters:</p>\n<ul>\n<li><code>s</code> (dot-all)</li>\n<li><code>m</code> (multi-line)</li>\n<li><code>i</code> (case insensitive)</li>\n<li><code>x</code> (comments)</li>\n</ul>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">replace(&quot;How do you feel?&quot;, &quot;Feel&quot;, &quot;FEEL&quot;, &quot;i&quot;)\n// &quot;How do you FEEL?&quot;\n</code></pre>\n'},{name:"split(string, delimiter)",description:'<p>Splits the given value into a list of substrings, breaking at each occurrence of the <code>delimiter</code> pattern.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">split(string: string, delimiter: string): list&lt;string&gt;\n</code></pre>\n<p>The <code>delimiter</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">split(&quot;John Doe&quot;, &quot;\\s&quot; )\n// [&quot;John&quot;, &quot;Doe&quot;]\n\nsplit(&quot;a;b;c;;&quot;, &quot;;&quot;)\n// [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;&quot;, &quot;&quot;]\n</code></pre>\n'},{name:"extract(string, pattern)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn&#39;t\nmatch.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">extract(string: string, pattern: string): list&lt;string&gt;\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">extract(&quot;references are 1234, 1256, 1378&quot;, &quot;12[0-9]*&quot;)\n// [&quot;1234&quot;,&quot;1256&quot;]\n</code></pre>\n'},{name:"trim(string)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">trim(&quot; hello world &quot;)\n// &quot;hello world&quot;\n\ntrim(&quot;hello world &quot;)\n// &quot;hello world&quot;\n</code></pre>\n'},{name:"uuid()",description:'<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">uuid()\n// &quot;7793aab1-d761-4d38-916b-b7270e309894&quot;\n</code></pre>\n'},{name:"to base64(value)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to base64(&quot;FEEL&quot;)\n// &quot;RkVFTA==&quot;\n</code></pre>\n'},{name:"is blank(string)",description:'<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is blank(&quot;&quot;)\n// true\n\nis blank(&quot; &quot;)\n// true\n\nis blank(&quot;hello world&quot;)\n// false\n</code></pre>\n'},{name:"now()",description:'<p>Returns the current date and time including the timezone.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">now(): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">now()\n// date and time(&quot;2020-07-31T14:27:30@Europe/Berlin&quot;)\n</code></pre>\n'},{name:"today()",description:'<p>Returns the current date.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">today(): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">today()\n// date(&quot;2020-07-31&quot;)\n</code></pre>\n'},{name:"day of week(date)",description:'<p>Returns the day of the week according to the Gregorian calendar. Note that it always returns the English name of the day.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">day of week(date: date): string\n</code></pre>\n<pre><code class="language-feel">day of week(date: date and time): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">day of week(date(&quot;2019-09-17&quot;))\n// &quot;Tuesday&quot;\n\nday of week(date and time(&quot;2019-09-17T12:00:00&quot;))\n// &quot;Tuesday&quot;\n</code></pre>\n'},{name:"day of year(date)",description:'<p>Returns the Gregorian number of the day within the year.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">day of year(date: date): number\n</code></pre>\n<pre><code class="language-feel">day of year(date: date and time): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">day of year(date(&quot;2019-09-17&quot;))\n// 260\n\nday of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// 260\n</code></pre>\n'},{name:"week of year(date)",description:'<p>Returns the Gregorian number of the week within the year, according to ISO 8601.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">week of year(date: date): number\n</code></pre>\n<pre><code class="language-feel">week of year(date: date and time): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">week of year(date(&quot;2019-09-17&quot;))\n// 38\n\nweek of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// 38\n</code></pre>\n'},{name:"month of year(date)",description:'<p>Returns the month of the year according to the Gregorian calendar. Note that it always returns the English name of the month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">month of year(date: date): string\n</code></pre>\n<pre><code class="language-feel">month of year(date: date and time): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">month of year(date(&quot;2019-09-17&quot;))\n// &quot;September&quot;\n\nmonth of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// &quot;September&quot;\n</code></pre>\n'},{name:"abs(n)",description:'<p>Returns the absolute value of a given duration.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">abs(n: days and time duration): days and time duration\n</code></pre>\n<pre><code class="language-feel">abs(n: years and months duration): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">abs(duration(&quot;-PT5H&quot;))\n// &quot;duration(&quot;PT5H&quot;)&quot;\n\nabs(duration(&quot;PT5H&quot;))\n// &quot;duration(&quot;PT5H&quot;)&quot;\n\nabs(duration(&quot;-P2M&quot;))\n// duration(&quot;P2M&quot;)\n</code></pre>\n'},{name:"last day of month(date)",description:'<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">last day of month(date: date): date\n</code></pre>\n<pre><code class="language-feel">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">last day of month(date(&quot;2022-10-01&quot;))\n// date(&quot;2022-10-31&quot;))\n\nlast day of month(date and time(&quot;2022-10-16T12:00:00&quot;))\n// date(&quot;2022-10-31&quot;))\n</code></pre>\n'}].map(F$);const Q$=new x_,H$=new x_;function W$({extensions:e=[],dialect:t="expression",parserDialect:n,container:i,contentAttributes:o={},tooltipContainer:r,onChange:s=(()=>{}),onKeyDown:a=(()=>{}),onLint:l=(()=>{}),placeholder:c="",readOnly:u=!1,value:h="",builtins:d=z$,variables:p=[]}){const f=xE.updateListener.of((e=>{e.docChanged&&s(e.state.doc.toString())})),g=xE.updateListener.of((e=>{const t=e.transactions.flatMap((e=>e.effects)).filter((e=>e.is(GA)));if(!t.length)return;const n=t.flatMap((e=>e.value));l(n)})),m=xE.domEventHandlers({keydown:a});"string"==typeof r&&(r=document.querySelector(r));const v=r?function(e={}){return LE.of(e)}({tooltipSpace:function(){return r.getBoundingClientRect()}}):[],y=[BM(),Q$.of(V$({dialect:t,builtins:d,variables:p,parserDialect:n})),rT(),W_.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,o=n.lineAt(i);if(i>o.from+VR)return e;let r=n.sliceString(o.from,i);if(!t.some((e=>e.test(r))))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=MR(s,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],o=TR(s,n);i!=o&&l.push({from:t.from,to:t.from+i.length,insert:o})}return l.length?[e,{changes:l,sequential:!0}]:e})),[TM,kM],xE.contentAttributes.of(o),f,m,SE.of([...zA]),k$,g,v,H$.of($E(c)),E$,...e];return u&&y.push(xE.editable.of(!1)),this._cmEditor=new xE({state:W_.create({doc:h,extensions:y}),parent:i}),this}W$.prototype.setValue=function(e){this._cmEditor.dispatch({changes:{from:0,to:this._cmEditor.state.doc.length,insert:e}})},W$.prototype.focus=function(e){const t=this._cmEditor;if(t.contentDOM.focus(),t.focus(),"number"==typeof e){const n=t.state.doc.length;t.dispatch({selection:{anchor:e<=n?e:n}})}},W$.prototype.getSelection=function(){return this._cmEditor.state.selection},W$.prototype.setVariables=function(e){const t={builtins:(n=this._cmEditor.state).facet(B$)[0],variables:n.facet(L$)[0],dialect:n.facet(N$)[0],parserDialect:n.facet(q$)[0]};var n;this._cmEditor.dispatch({effects:[Q$.reconfigure(V$({...t,variables:e}))]})},W$.prototype.setPlaceholder=function(e){this._cmEditor.dispatch({effects:H$.reconfigure($E(e))})};let U$=class extends Ds{constructor(e,t){super(e,t),this.node=null,this.editor=null,this.state={value:e.value}}componentDidMount(){this.editor=new W$({contentAttributes:{"aria-label":this.props.label},container:this.node,onChange:this.handleChange,value:this.state.value,variables:this.props.variables||[],extensions:[xE.lineWrapping]}),this.node.addEventListener("mousedown",this.handleMouseEvent),this.node.addEventListener("keydown",this.handleKeyDownCapture,!0),this.node.addEventListener("keydown",this.handleKeyDown),this.props.autoFocus&&this.editor.focus(this.state.value.length)}componentDidUpdate(e){const{value:t}=this.props;e.value!==t&&t!==this.state.value&&this.setState({value:t},(()=>{this.editor.setValue(t)})),function(e,t){return JSON.stringify(e)===JSON.stringify(t)}(e.variables,this.props.variables)||this.editor.setVariables(this.props.variables)}componentWillUnmount(){this.node.removeEventListener("mousedown",this.handleMouseEvent),this.node.removeEventListener("keydown",this.handleKeyDownCapture,!0),this.node.removeEventListener("keydown",this.handleKeyDown)}handleMouseEvent=e=>{e.stopPropagation()};handleKeyDownCapture=e=>{if("Enter"===e.key){if(function(e){return e.querySelector(".cm-tooltip-autocomplete")}(this.node))return void(e.triggeredFromAutocomplete=!0);this.props.ctrlForNewline&&!function(e){return e.metaKey||e.ctrlKey}(e)&&e.preventDefault(),this.props.singleLine&&e.preventDefault()}};handleKeyDown=e=>{["Enter","Escape"].includes(e.key)&&e.triggeredFromAutocomplete&&e.stopPropagation()};handleChange=e=>{const{onInput:t}=this.props;this.setState({value:e}),t&&t(e)};handleBlur=()=>{const{onBlur:e,onChange:t}=this.props;t&&this.state.value!==this.props.value&&t(this.state.value),e&&e()};setNode=e=>{this.node=e};render(){return vr(1,"div",["literal-expression",this.props.className||""].join(" "),null,1,{onClick:this.handleMouseEvent,onFocusIn:this.props.onFocus,onFocusOut:this.handleBlur},null,this.setNode)}};class X$ extends Ds{constructor(e,t){super(e,t),this.translate=t.injector.get("translate"),this.expressionLanguages=t.injector.get("expressionLanguages",!1),this.variableResolver=t.injector.get("variableResolver",!1),this.handleValue=e=>{let t={text:e};this.handleChange(t)},this.handleLabelChange=e=>{var t=e||void 0;this.handleChange({label:t})}}handleChange(e){var{onChange:t}=this.props;"function"==typeof t&&t(e)}getExpressionEditorComponent(){return this.expressionLanguages&&"feel"!==this.expressionLanguages.getDefault("inputCell").value?gx:U$}handleKeyDown=e=>{"Enter"===e.key&&e.stopPropagation()};_getVariables(){return this.variableResolver&&this.variableResolver.getVariables(this.props.element)}render(){const{label:e,text:t}=this.props,n=this.getExpressionEditorComponent(),i=this._getVariables();return vr(1,"div","context-menu-container ref-input-editor input-edit",[vr(1,"div","dms-form-control",yr(2,gx,{label:this.translate("Input label"),className:"dms-input-label",value:e||"",placeholder:this.translate("Input"),singleLine:!0,onInput:this.handleLabelChange}),2),vr(1,"div","dms-form-control",[vr(1,"label","dms-label",this.translate("Expression"),0),yr(2,n,{label:this.translate("Input expression"),placeholder:this.translate("Enter expression"),className:["ref-text","dms-input"].join(" "),onInput:this.handleValue,value:t||"",variables:i})],4)],4,{onKeyDown:this.handleKeyDown})}}class K$ extends Ds{constructor(e,t){super(e,t),this.state={},av(this),this.persistChanges=this.debounceInput(this.persistChanges)}persistChanges=()=>{const{input:e}=this.props.context,{unsaved:t}=this.state;if(!t)return;const{label:n,...i}=t;var o,r={};"label"in t&&(r.label=n),o=i,Object.keys(o).length&&(r.inputExpression=i),this.modeling.updateProperties(e,r),this.setState({unsaved:!1})};handleChange=e=>{this.setState({unsaved:{...this.state.unsaved,...e}},this.persistChanges)};getValue(e){let{input:t}=this.props.context;const{unsaved:n}=this.state;let i=t;return"text"===e&&(i=i.inputExpression),n&&e in n?n[e]:i.get(e)}render(){return yr(2,X$,{label:this.getValue("label"),text:this.getValue("text"),element:this.props.context.input,onChange:this.handleChange})}}K$.$inject=["debounceInput","modeling","injector"];class G$ extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._eventBus=t.injector.get("eventBus")}onClick=e=>{const{col:t}=this.props;this._eventBus.fire("input.edit",{event:e,input:t})};render(){return vr(1,"button","edit-button dmn-icon-edit",null,1,{"aria-label":this._translate("Edit input"),type:"button",onClick:this.onClick})}}class Y${constructor(e,t,n,i){e.onGetComponent("cell",(({cellType:e})=>{if("input-header"===e)return vb})),e.onGetComponent("context-menu",((e={})=>{if("input-edit"===e.contextMenuType)return K$})),e.onGetComponent("cell-inner",((e={})=>{const{cellType:t}=e;if("input-cell"===t)return G$})),n.on("input.edit",(({event:e,input:n})=>{const{target:i}=e,o=Bt(i,"th",!0),{left:r,top:s}=o.getBoundingClientRect();t.open({x:r,y:s,align:"bottom-right"},{contextMenuType:"input-edit",input:n})}))}}Y$.$inject=["components","contextMenu","eventBus","renderer"];class Z$ extends Ds{constructor(e,t){super(e,t),av(this);const{value:n}=e;this.state={value:n,optionsVisible:!1},this._portalEl=null}componentDidMount(){document.addEventListener("mousedown",this.onGlobalClick),document.addEventListener("focusin",this.onFocusChanged),this.keyboard.addListener(this.onKeyboard)}componentWillUnmount(){document.removeEventListener("focusin",this.onFocusChanged),document.removeEventListener("mousedown",this.onGlobalClick),this.keyboard.removeListener(this.onKeyboard),this.removePortalEl()}componentWillReceiveProps(e){const{value:t}=e;this.setState({value:t})}componentWillUpdate(e,t){const{optionsVisible:n}=t;n?this._portalEl||this.addPortalEl():this._portalEl&&this.removePortalEl()}componentDidUpdate(){const{optionsVisible:e}=this.state;if(!e||!this.inputNode)return;const t=this.getOptionsBounds();M(this._portalEl.style,t)}getOptionsBounds(){const e=this.renderer.getContainer(),{top:t,left:n,bottom:i}=e.getBoundingClientRect(),{top:o,left:r,width:s,height:a,bottom:l}=this.inputNode.getBoundingClientRect(),c=o+a-t+e.scrollTop,u={top:`${c}px`,left:`${r-n+e.scrollLeft}px`,width:`${s}px`,"max-height":`calc(100% - ${c}px)`};if(i-l<a){const e=i-o;u.bottom=`${e}px`,u["max-height"]=`calc(100% - ${e})`,delete u.top}return u}addPortalEl(){this._portalEl=Gt('<div class="dms-select-options"></div>');this.renderer.getContainer().appendChild(this._portalEl),this._portalEl.addEventListener("mousedown",J$)}removePortalEl(){this._portalEl&&(this._portalEl.removeEventListener("mousedown",J$),en(this._portalEl),this._portalEl=null)}onChange=e=>{this.setState({value:e});const{onChange:t}=this.props;"function"==typeof t&&t(e)};onInputClick=e=>{e.preventDefault(),e.stopPropagation(),this.setOptionsVisible(!this.state.optionsVisible),this.focusInput()};onInput=e=>{const{value:t}=e.target;this.onChange(t)};onOptionClick=(e,t)=>{t.preventDefault(),t.stopPropagation(),this.setOptionsVisible(!1),this.onChange(e),this.focusInput()};focusInput(){const e=this.inputNode;e.focus(),"selectionStart"in e&&(e.selectionStart=1e5)}checkClose(e){!this._portalEl||this._portalEl.contains(e)||this.parentNode.contains(e)||this.setOptionsVisible(!1)}onFocusChanged=e=>{this.checkClose(e.target)};onGlobalClick=e=>{this.checkClose(e.target)};select(e){const{options:t}=this.props,{value:n}=this.state;if(!t)return;const i=t.filter((e=>e.value===n))[0],o=i?t.indexOf(i):-1,r=-1===o?1===e?0:t.length-1:(o+e)%t.length,s=t[r<0?t.length+r:r];this.onChange(s.value)}setOptionsVisible(e){this.setState({optionsVisible:e})}onKeyDown=e=>{const{optionsVisible:t}=this.state;var n=e.which;40!==n&&38!==n||(e.stopPropagation(),e.preventDefault(),t?this.select(40===n?1:-1):this.setOptionsVisible(!0)),t&&(13!==n&&27!==n||(e.stopPropagation(),e.preventDefault(),this.setOptionsVisible(!1)))};onKeyboard=e=>{const{optionsVisible:t}=this.state;if(t)return 27===e?(this.setOptionsVisible(!1),!0):void 0};renderOptions(e,t){return vr(1,"div","options",e.map((e=>vr(1,"div",["option",t===e?"active":""].join(" "),e.label,0,{"data-value":e.value,onClick:t=>this.onOptionClick(e.value,t)}))),0)}render(){const{className:e,label:t,id:n,options:i,noInput:o,title:r}=this.props,{optionsVisible:s,value:a}=this.state,l=!!i&&i.filter((e=>e.value===a))[0],c=l?l.label:a;return vr(1,"div",[e||"","dms-input-select"].join(" "),[o?vr(1,"div","dms-input",c,0,{"aria-label":t,tabIndex:"0",onKeyDown:this.onKeyDown},null,(e=>this.inputNode=e)):vr(64,"input","dms-input",null,1,{"aria-label":t,onInput:this.onInput,onKeyDown:this.onKeyDown,spellCheck:"false",type:"text",value:a,id:n},null,(e=>this.inputNode=e)),vr(1,"span",["dms-input-select-icon",s?"dmn-icon-up":"dmn-icon-down"].join(" ")),s&&(u=this.renderOptions(i,l),h=this._portalEl,vr(1024,h,null,u,0,null,nr(u)?null:u.key,null))],0,{title:r,onClick:this.onInputClick},null,(e=>this.parentNode=e));var u,h}}function J$(e){e.stopPropagation()}Z$.$inject=["keyboard","renderer"];class ej extends Ds{constructor(e,t){super(e),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling"),this._dataTypes=t.injector.get("dataTypes")}onTypeChange=e=>{const t=this.getElement(),n=hn(t,"dmn:LiteralExpression")?t.$parent:t;let i;dn(n)?i={inputExpression:{typeRef:e}}:pn(n)&&(i={typeRef:e}),this._modeling.updateProperties(n,i)};getElement(){return this.props.context.input||this.props.context.output}render(){const e=this.getElement(),t=(hn(e,"dmn:InputClause")?e.inputExpression:e).typeRef,n=this._dataTypes.getAll().map((e=>({label:this._translate(e),value:e}))),i=this._translate("Type");return vr(1,"div","type-ref-edit context-menu-container",vr(1,"div","dms-form-control",[vr(1,"label","dms-label",[i,xr(":")],0),yr(2,Z$,{className:"type-ref-edit-select",label:i,onChange:this.onTypeChange,options:n,value:t})],4),2)}}class tj{constructor(e){e.onGetComponent("context-menu",750,((e={})=>{const{contextMenuType:t}=e;if("input-edit"===t||"output-edit"===t)return ej}))}}tj.$inject=["components"];var nj={__depends__:[Ux,ob],__init__:["typeRefEditingProvider"],typeRefEditingProvider:["type",tj]};class ij extends Gd{constructor(e,t){super(e),this.postExecuted("element.updateProperties",(e=>{const{element:n,properties:i}=e.context,o=dn(n)?i.inputExpression:i;if(o&&o.typeRef&&"string"!==o.typeRef){const e=hn(n,"dmn:LiteralExpression")?n.$parent:n;t.editAllowedValues(e,null)}}))}}ij.$inject=["eventBus","modeling"];class oj extends Ds{constructor(e,t){super(e,t);const{items:n}=e;this.state={items:n}}componentWillReceiveProps(e){const{items:t}=e;this.setState({items:t})}getRemoveClickHandler=e=>t=>{t.stopPropagation(),this.removeItem(e)};getToggleClickHandler=e=>t=>{t.stopPropagation(),this.toggleItem(e)};removeItem=e=>{const{onChange:t}=this.props,n=this.state.items.filter((t=>t!==e));this.setState({items:n}),t&&t(n)};toggleItem=e=>{const{onChange:t,type:n}=this.props,i=this.state.items.map((t=>(t===e?t.isChecked=!t.isChecked:"radio"===n&&(t.isChecked=!1),t)));this.setState({items:i}),t&&t(i)};render(){const{className:e,items:t,type:n,labelComponent:i}=this.props,o=["dms-list-component"];e&&o.push(e);const r=function(e){const t=[];for(let n in e)t.push([n,e[n]]);return t}(b(t,"group"));return vr(1,"div",o.join(" "),r.map((e=>{const t=e[0],o=e[1];return vr(1,"div","group",[i&&i(t)||vr(1,"h4","dms-heading",t,0),vr(1,"ul","items no-wrap",o.map((e=>vr(1,"li","item",[n&&vr(64,"input","item-toggle",null,1,{type:n,checked:e.isChecked,onClick:this.getToggleClickHandler(e)}),xr(" "),e.value,e.isRemovable&&vr(1,"span","remove dmn-icon-clear",null,1,{title:"Remove item",onClick:this.getRemoveClickHandler(e)})],0))),0)],0)})),0)}}class rj extends Ds{constructor(e,t){super(e,t);const{validate:n,value:i}=e,o=n?n(i||""):void 0;this.state={validationWarning:o,value:i},this.onInput=this.onInput.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this)}componentWillReceiveProps(e){const{validate:t,value:n}=e,i=t?t(n||""):void 0;this.setState({validationWarning:i,value:n})}onInput(e){const{onInput:t,validate:n}=this.props,i=n?n(e):void 0;this.setState({validationWarning:i,value:e}),"function"==typeof t&&t&&t({isValid:!i,value:e})}onKeyDown(e){const{target:t}=e,{value:n}=t,{onKeyDown:i,validate:o}=this.props,r=o?o(n):void 0;"function"==typeof i&&i({isValid:!r,value:n,event:e})}onKeyUp(e){const{target:t}=e,{value:n}=t,{onKeyUp:i,validate:o}=this.props,r=o?o(n):void 0;"function"==typeof i&&i({isValid:!r,value:n,event:e})}render(){const{placeholder:e,type:t,className:n,label:i}=this.props,{validationWarning:o,value:r}=this.state,s=["dms-validated-input",n].join(" "),a=[];return o&&a.push("invalid"),vr(1,"div",s,[yr(2,hb,{className:a,label:i,onInput:this.onInput,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,placeholder:e||"",type:t,value:r||""}),o&&vr(1,"p","dms-hint dms-validation-warning",o,0)],0)}}function sj(e){if(!e||function(e){return""===e}(e.trim()))return{values:[]};let t=e.split(",");const n={values:[]};let i="";return t.forEach((e=>{i+=e,/^"[^"]*"$/.test(i.trim())?(n.values.push(i.trim()),i=""):i+=","})),i?void 0:n}let aj=class extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling"),this._changeSupport=t.changeSupport;const n=this.getAllowedValuesTarget(),i=sj(n.inputValues&&n.inputValues.text||n.outputValues&&n.outputValues.text||"");this.state=i?{values:i.values.map((e=>({value:e,isCheckable:!1,isRemovable:!0,group:this._translate("Predefined values")}))),inputValue:""}:{values:null,inputValue:""}}onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const e=this.getAllowedValuesTarget();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}componentWillUnmount(){const e=this.getAllowedValuesTarget();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}setPredefinedValues=e=>{const t=this.getAllowedValuesTarget();this.setState({values:e}),this._modeling.editAllowedValues(t,e&&function(e){return e.map((e=>e.value))}(e))};onListChange=e=>{this.setPredefinedValues(e)};getAllowedValuesTarget(){const e=this.getElement();return hn(e,"dmn:LiteralExpression")?e.$parent:e}onInput=({isValid:e,value:t})=>{this.setState({inputValue:t})};onKeyDown=({isValid:e,event:t})=>{if(13===t.keyCode&&(t.stopPropagation(),t.preventDefault(),e)){const{inputValue:e,values:t}=this.state,n=sj(e);this.onListChange((t||[]).concat(n.values.map((e=>({value:e,isCheckable:!1,isRemovable:!0,group:this._translate("Predefined values")}))))),this.setState({inputValue:""})}};handleRemovePredifinedValuesClick=e=>{e.stopPropagation(),this.removePredefinedValues()};removePredefinedValues=()=>{this.setPredefinedValues(null)};getElement(){return this.props.context.output||this.props.context.input.inputExpression}render(){const e=this.getElement(),{inputValue:t,values:n}=this.state;return"string"===e.typeRef?vr(1,"div","context-menu-container allowed-values-edit",vr(1,"div","dms-form-control",[!cj(n)&&n.length>0&&yr(2,oj,{labelComponent:lj,items:n,onChange:this.onListChange}),!cj(n)&&!n.length&&vr(1,"div",null,[vr(1,"label","dms-label",this._translate("Predefined values"),0),vr(1,"span","placeholder",this._translate("No values"),0)],4),!cj(n)&&vr(1,"p","dms-hint",vr(1,"button","del-values",this._translate("Clear predefined values"),0,{type:"button",onClick:this.handleRemovePredifinedValuesClick}),2),vr(1,"label","dms-label",this._translate("Add predefined values"),0),yr(2,rj,{onInput:this.onInput,onKeyDown:this.onKeyDown,placeholder:this._translate('"value", "value", ...'),type:"text",validate:e=>{if(!sj(e))return this._translate("Strings must be in double quotes")},value:t})],0),2):null}};function lj(e){return vr(1,"label","dms-label",e,0)}function cj(e){return null===e}class uj{constructor(e){e.onGetComponent("context-menu",500,((e={})=>{const{contextMenuType:t}=e;if("input-edit"===t||"output-edit"===t)return aj}))}}uj.$inject=["components"];var hj={__init__:["allowedValuesUpdateBehavior","allowedValuesEditingProvider"],allowedValuesUpdateBehavior:["type",ij],allowedValuesEditingProvider:["type",uj]};class dj extends Ds{constructor(e,t){super(e,t),this._sheet=t.injector.get("sheet"),this._eventBus=t.injector.get("eventBus"),this._changeSupport=t.changeSupport,this._translate=t.injector.get("translate")}onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const e=this.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}componentWillUnmount(){const e=this.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}getRoot(){return this._sheet.getRoot()}handleClick=e=>{e.stopPropagation(),this.add()};add=()=>{this._eventBus.fire("addInput")};render(){return vr(1,"div","add-input actionable",vr(1,"button","dmn-icon-plus action-icon",null,1,{title:this._translate("Add input")}),2,{onClick:this.handleClick})}}class pj extends Ds{constructor(e,t){super(e,t),this._sheet=t.injector.get("sheet"),this._eventBus=t.injector.get("eventBus"),this._changeSupport=t.changeSupport,this._translate=t.injector.get("translate")}onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){const e=this.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}componentWillUnmount(){const e=this.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}getRoot(){return this._sheet.getRoot()}handleClick=e=>{e.stopPropagation(),this.add()};add=()=>{this._eventBus.fire("addOutput")};render(){return vr(1,"div","add-output actionable",vr(1,"button","dmn-icon-plus action-icon",null,1,{title:this._translate("Add output")}),2,{onClick:this.handleClick})}}function fj(e,t,n){e.onGetComponent("cell-inner",((e={})=>{const{cellType:t,index:n,inputsLength:i,outputsLength:o}=e;return"input-cell"===t&&n===i-1?dj:"output-cell"===t&&n===o-1?pj:void 0})),n.on("addInput",(()=>{t.trigger("addInput")})),n.on("addOutput",(()=>{t.trigger("addOutput")}))}fj.$inject=["components","editorActions","eventBus"];var gj={__depends__:[ax],__init__:["addInputOutputProvider"],addInputOutputProvider:["type",fj]},mj="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/pull/662";let vj=class{constructor(e,t,n,i,o){this._config=e||{},this._editorActions=n,this._eventBus=t,this._cellSelection=i,this._listeners=[],t.on("table.destroy",this._destroy),t.on("table.init",this._init),t.on("attach",(()=>{this._config.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(mj)),this._target=o.getContainer(),this._config&&!1!==this._config.bind&&this.bind()})),t.on("detach",this.unbind)}_init=()=>{this._registerDefaultBindings(),this._fire("init")};_destroy=()=>{this._fire("destroy"),this.unbind(),this._listeners=null};_keyHandler=e=>{var t,n,i=this._listeners,o=e.keyCode||e.charCode||-1;for(t=0;n=i[t];t++)if(n(o,e))return e.preventDefault(),void e.stopPropagation()};bind(e){e&&console.error("unsupported argument <node>",new Error(mj)),this.unbind(),e=this._node=this._target,zt.bind(e,"keydown",this._keyHandler),this._fire("bind")}getBinding(){return this._node}unbind=()=>{var e=this._node;e&&(this._fire("unbind"),zt.unbind(e,"keydown",this._keyHandler)),this._node=null};_fire(e){this._eventBus.fire("keyboard."+e,{node:this._node,listeners:this._listeners})}_registerDefaultBindings(){var e=this._listeners,t=this._editorActions,n=this._cellSelection;e.push((function(e,n){if(Xx(n)&&!Kx(n)&&90===e)return t.trigger("undo"),!0})),e.push((function(e,n){if(Xx(n)&&(89===e||90===e&&Kx(n)))return t.trigger("redo"),!0})),e.push((function(e,n){if(13===e&&!Xx(n)&&Kx(n)&&Ay(n.target))return t.trigger("selectCellAbove"),!0})),e.push((function(e,i){if(13!==e||Xx(i)||Kx(i))return;if(!Ay(i.target))return;const o=t.trigger("selectCellBelow"),r=n.getCellSelection();if(!o&&r&&"__decisionProperties_name"!==r){const e=t.trigger("addRule");return t.trigger("selectCellBelow"),e}return!0}))}addListener(e){this._listeners.unshift(e)}removeListener(e){this._listeners=this._listeners.filter((t=>t!==e))}};vj.$inject=["config.keyboard","eventBus","editorActions","cellSelection","renderer"];var yj={__depends__:[ax],__init__:["keyboard"],keyboard:["type",vj]},xj={__depends__:[gj,hj,Ux,wx,jv,yj,nj],__init__:["inputEditingProvider","outputEditingProvider"],inputEditingProvider:["type",Y$],outputEditingProvider:["type",mb]};function bj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let _j=class{constructor(e,t,n,i){bj(this,"handleDragOver",(e=>{wj(e);const t=Bt(e.target,".dmn-decision-table-container td,\n .dmn-decision-table-container th",!0);let n=!!t;const{hoverEl:i}=this._dragContext;i&&i!==t&&(this._emit("dragAndDrop.dragLeave",e),this._dragContext.targetEl=null,this._dragContext.hoverEl=null),t&&(t!==i&&(this._dragContext.hoverEl=t,n=this._emit("dragAndDrop.dragEnter",e),!1!==n&&(this._dragContext.targetEl=t)),n=this._emit("dragAndDrop.dragOver",e)),e.dataTransfer.dropEffect=!1!==n?"move":"none"})),bj(this,"handleDrop",(e=>{wj(e);const t=this._emit("dragAndDrop.drop",e);if(t){const{draggedElement:e}=this._dragContext;if(e instanceof Nm){const{rows:n}=this._sheet.getRoot();let i=n.indexOf(t);this._modeling.moveRow(e,i)}else if(e instanceof qm){const{cols:n}=this._sheet.getRoot();let i=n.indexOf(t);this._modeling.moveCol(e,i)}}this.handleDragEnd(e)})),bj(this,"handleDragEnd",(e=>{wj(e),this._unbindListeners(),this._emit("dragAndDrop.dragEnd",e),this._dragContext=null})),this._eventBus=e,this._renderer=t,this._modeling=n,this._sheet=i,this._dragContext=null,e.on("table.destroy",(()=>{this._unbindListeners()}))}_bindListeners(){zt.bind(document,"dragover",this.handleDragOver),zt.bind(document,"drop",this.handleDrop),zt.bind(document,"dragend",this.handleDragEnd)}_unbindListeners(){zt.unbind(document,"dragover",this.handleDragOver),zt.unbind(document,"drop",this.handleDrop),zt.unbind(document,"dragend",this.handleDragEnd)}_emit(e,t){return this._eventBus.fire(e,{dragContext:this._dragContext,originalEvent:t})}startDrag(e,t){wj(t,!0),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData&&t.dataTransfer.setData("text","__DUMMY"),this._dragContext={draggedElement:e},this._bindListeners(),this._emit("dragAndDrop.dragStart",t)}};function wj(e,t){e.stopPropagation(),!0!==t&&e.preventDefault()}_j.$inject=["eventBus","renderer","modeling","sheet"];var Cj={__init__:["dragAndDrop"],dragAndDrop:["type",_j]};const Oj="top",kj="left";class Ej{constructor(e,t,n,i,o,r,s,a){this._elementRegistry=t,this._dragAndDrop=i,this._renderer=o,this._rules=r,this._sheet=s,this._translate=a,e.onGetComponent("cell-inner",(({cellType:e,col:t,row:n})=>{if("rule-index"===e)return()=>vr(1,"span","dmn-icon-drag vertical",xr(" "),2,{draggable:"true",onDragStart:e=>this.startDrag(n,e),title:this._translate("Move rule")});if("input-cell"===e||"output-cell"===e){let e="Move "+(dn(t)?"Input":"Output");return()=>vr(1,"span","dmn-icon-drag horizontal",null,1,{draggable:"true",onDragStart:e=>this.startDrag(t,e),title:e})}})),n.on("dragAndDrop.dragEnter",(e=>{const{dragContext:t}=e,{draggedElement:n,hoverEl:i}=t;if(n instanceof Nm)return!0;if(n instanceof qm){const e=function(e,t,n){const i=t.get(e.dataset.colId);if(!i)return-1;const{cols:o}=n.getRoot();return o.indexOf(i)}(i,this._elementRegistry,this._sheet);if(-1===e)return!1;return this._rules.allowed("col.move",{col:n,index:e})}return!1})),n.on("dragAndDrop.dragLeave",(e=>{const{dragContext:t}=e,{targetEl:n}=t;if(!n)return;Tj(this._renderer.getContainer())})),n.on("dragAndDrop.dragOver",(e=>{const{dragContext:t,originalEvent:n}=e,{draggedElement:i,lastPosition:o,targetEl:r}=t,s=this._renderer.getContainer();if(!r)return!1;let a;return i instanceof Nm&&(a=Aj(n,r)),i instanceof qm&&(a=Mj(n,r)),o===a||(Tj(s),i instanceof Nm&&Sj(r,s,a===Oj?"top":"bottom"),i instanceof qm&&Rj(r,s,a===kj?"left":"right"),t.lastPosition=a),!0})),n.on("dragAndDrop.drop",(e=>{const{dragContext:t,originalEvent:n}=e,{draggedElement:i,targetEl:o}=t;if(!o)return!1;if(i instanceof Nm){const e=Aj(n,o),t=o.dataset.rowId,r=this._elementRegistry.get(t);if(!r||r===i)return;const s=function(e,t,n,i){i.indexOf(e)>i.indexOf(t)&&(t=function(e,t){const n=t.indexOf(e);return t[Math.min(t.length-1,n+1)]}(t,i));return n===Oj?function(e,t){const n=t.indexOf(e);return t[Math.max(0,n-1)]}(t,i):t}(i,r,e,this._sheet.getRoot().rows);if(s===i)return;return s}if(i instanceof qm){const e=Mj(n,o),t=o.dataset.colId,r=this._elementRegistry.get(t);if(!r||r===i)return;const s=function(e,t,n,i){i.indexOf(e)>i.indexOf(t)&&(t=function(e,t){const n=t.indexOf(e);if(dn(e)){const e=t.filter((e=>dn(e))),i=e[e.length-1],o=t.indexOf(i);return t[Math.min(o,n+1)]}return t[Math.min(t.length-1,n+1)]}(t,i));return n===kj?function(e,t){const n=t.indexOf(e);if(pn(e)){const e=t.filter((e=>pn(e)))[0],i=t.indexOf(e);return t[Math.max(i,n-1)]}return t[Math.max(0,n-1)]}(t,i):t}(i,r,e,this._sheet.getRoot().cols);if(s===i)return;return s}})),n.on("dragAndDrop.dragEnd",this._cleanup)}startDrag(e,t){const n=this._renderer.getContainer();this._dragImage=Gt('<span style="\n visibility: hidden;\n position: fixed;\n top: -10000px\n "></span>'),document.body.appendChild(this._dragImage),t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(this._dragImage,0,0),e instanceof Nm?function(e,t){const n=Jt(`[data-row-id=${e.id}]`,t);p(n,(e=>{Pj(e)&&$t(e).add("dragged")}))}(e,n):e instanceof qm&&function(e,t){const n=Jt(`[data-col-id=${e.id}]`,t);p(n,(e=>{Pj(e)&&$t(e).add("dragged")}))}(e,n),this._dragAndDrop.startDrag(e,t)}_cleanup=()=>{const e=this._renderer.getContainer();Tj(e),function(e){const t=Jt(".dragged",e);p(t,(e=>{Pj(e)&&$t(e).remove("dragged")}))}(e),this._dragImage&&(en(this._dragImage),this._dragImage=null)}}function Sj(e,t,n){const i=e.dataset.rowId;if(!i)return;p(Jt(`[data-row-id=${i}]`,t),(e=>{Pj(e)&&($t(e).add("dragover"),$t(e).add(n))}))}function Rj(e,t,n){const i=e.dataset.colId;if(!i)return;p(Jt(`[data-col-id=${i}]`,t),(e=>{Pj(e)&&($t(e).add("dragover"),$t(e).add(n))}))}function Tj(e){p(Jt(".dragover",e),(e=>{Pj(e)&&($t(e).remove("dragover"),$t(e).remove("top"),$t(e).remove("right"),$t(e).remove("bottom"),$t(e).remove("left"))}))}function Mj(e,t){const n=t.getBoundingClientRect();return e.clientX<n.left+n.width/2?kj:"right"}function Aj(e,t){const n=t.getBoundingClientRect();return e.clientY<n.top+n.height/2?Oj:"bottom"}function Pj(e){return e&&(1===e.nodeType||11==e.nodeType)}Ej.$inject=["components","elementRegistry","eventBus","dragAndDrop","renderer","rules","sheet","translate"];var Dj={__depends__:[Cj,qy],__init__:["dmnDragAndDrop"],dmnDragAndDrop:["type",Ej]};class $j extends Ds{constructor(e,t){super(e,t),this._elementRegistry=t.injector.get("elementRegistry"),this._modeling=t.injector.get("modeling"),this._changeSupport=this.context.changeSupport;const{id:n}=this.props.context;this._element=this._elementRegistry.get(n)}onElementsChanged=()=>{this.forceUpdate()};componentWillMount(){this._element&&this._changeSupport.onElementsChanged(this._element.id,this.onElementsChanged)}componentDidMount(){const{autoFocus:e}=this.props.context;if(e&&this.node){Zt(".content-editable",this.node).focus()}}componentWillUnmount(){if(this._element){this._changeSupport.offElementsChanged(this._element.id,this.onElementsChanged);const{businessObject:e}=this._element,{description:t}=e;c(t)&&!t.length&&this.changeDescription(null)}}changeDescription=e=>{this._modeling.updateProperties(this._element,{description:e})};render(){if(!this._element)return;const{businessObject:e}=this._element,{description:t}=e;return c(t)?vr(1,"div","context-menu-container description-editor",yr(2,jj,{className:"dms-input",onChange:this.changeDescription,value:t}),2,null,null,(e=>this.node=e)):void 0}}let jj=class extends vx{render(){return vr(1,"div",this.getClassName(),this.getEditor(),0)}};class Ij{constructor(e,t,n,i,o,r,s){this._contextMenu=t,this._modeling=o,this._renderer=r,this._translate=s,i.on("cell.click",750,(e=>{if(e.defaultPrevented)return;const{target:i,id:o}=e,s=n.get(o);if(!gn(s,["dmn:UnaryTests","dmn:LiteralExpression"]))return;Lj(s)||e.preventDefault();const a=Bj(r.getContainer(),i.getBoundingClientRect());t.open(a,{contextMenuType:"cell-description",autoFocus:!1,id:o,offset:{x:4,y:4}})})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"cell-description"===e.contextMenuType){if(c(Lj(n.get(e.id))))return $j}})),e.onGetComponent("context-menu-cell-additional",500,((e={})=>{if(e.contextMenuType&&"context-menu"===e.contextMenuType){const{id:t}=e;if(!t)return;const i=n.get(t);if(!i)return;const{businessObject:o}=i,{description:r}=o,s=c(r),a=s?()=>this.removeDescription(i):()=>this.addDescription(i);return vr(1,"div",`context-menu-group-entry ${s?"remove-description":"add-description"}`,c(r)?this._translate("Remove cell description"):this._translate("Add cell description"),0,{onClick:a})}}))}addDescription=e=>{this._modeling.updateProperties(e,{description:""});const t=this._renderer.getContainer(),n=Bj(t,My(e.id,t).getBoundingClientRect());this._contextMenu.open(n,{contextMenuType:"cell-description",id:e.id,autoFocus:!0,offset:{x:4,y:4}})};removeDescription=e=>{this._modeling.updateProperties(e,{description:null}),this._contextMenu.close()}}function Bj(e,t){const{top:n,left:i,width:o,height:r}=t;return{x:i+e.parentNode.scrollLeft-26,y:n+e.parentNode.scrollTop,width:o+52,height:r}}function Lj(e){return e&&e.businessObject&&e.businessObject.description}Ij.$inject=["components","contextMenu","elementRegistry","eventBus","modeling","renderer","translate"];var Nj={__depends__:[Ux,ry],__init__:["description"],description:["type",Ij]};let qj=class{constructor(e,t,n,i,o,r){this._modeling=n,this._translate=o,this._expressionLanguages=i,e.onGetComponent("context-menu-cell-additional",((e={})=>{if(e.contextMenuType&&"context-menu"===e.contextMenuType){const{event:n,id:i}=e;if(!i)return;const o=t.get(i);if(!o)return;if(!this._shouldDisplayContextMenuEntry(o))return;const s=e=>{r.open({x:(n||e).pageX,y:(n||e).pageY},{contextMenuType:"expression-language",id:i})};return vr(1,"div","context-menu-group-entry",this._translate("Change cell expression language"),0,{onClick:s})}})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"expression-language"===e.contextMenuType){const{id:n}=e;if(!n)return;const o=t.get(n);if(!o)return;const r=this._getElementExpressionLanguage(o),s=i.getAll(),a="context-menu-group-entry context-menu-entry-set-expression-language",l=this._translate("Expression language");return()=>vr(1,"div","context-menu-flex",vr(1,"div","context-menu-group",vr(1,"div",a,[vr(1,"div",null,l,0),yr(2,Z$,{label:l,className:"expression-language",onChange:e=>this.onChange(o,e),options:s,value:r})],4),2),2)}})),e.onGetComponent("context-menu",((e={})=>{if("input-edit"===e.contextMenuType)return()=>{const{inputExpression:t}=e.input;if(!this._shouldDisplayContextMenuEntry(t))return;const n=this._getElementExpressionLanguage(t),o=i.getAll(),r=this._translate("Expression language");return vr(1,"div","context-menu-container ref-language",vr(1,"div","dms-form-control",[vr(1,"label","dms-label",r,0),yr(2,Z$,{label:r,className:"ref-language",value:n||"",onChange:e=>this.onChange(t,e),options:o})],4),2)}}))}onChange(e,t){this._modeling.editExpressionLanguage(e,t)}_shouldDisplayContextMenuEntry(e){if(this._expressionLanguages.getAll().length>1)return!0;return this._getElementExpressionLanguage(e)!==this._getDefaultElementExpressionLanguage(e)}_getElementExpressionLanguage(e){return fn(e).expressionLanguage||this._getDefaultElementExpressionLanguage(e)}_getDefaultElementExpressionLanguage(e){return this._expressionLanguages.getDefault(dn(e.col)?"inputCell":"outputCell").value}};qj.$inject=["components","elementRegistry","modeling","expressionLanguages","translate","contextMenu"];var Vj={__depends__:[jv],__init__:["expressionLanguage"],expressionLanguage:["type",qj]};class Fj extends Ds{constructor(e,t){super(e,t),av(this)}componentWillMount(){this.setupChangeListeners({bind:this.getBusinessObject().id})}componentWillUnmount(){this.setupChangeListeners({unbind:this.getBusinessObject().id})}setupChangeListeners({bind:e,unbind:t}){"string"==typeof t&&this.changeSupport.offElementsChanged(t,this.onElementsChanged),"string"==typeof e&&this.changeSupport.onElementsChanged(e,this.onElementsChanged)}getBusinessObject(){return this.sheet.getRoot().businessObject.$parent}onElementsChanged=()=>{this.forceUpdate()};setDecisionTableName=e=>{this.modeling.editDecisionTableName(e)};render(){const e=this.getBusinessObject(),{name:t}=e,n=this.components.getComponent("hit-policy")||Qj;return vr(1,"div","decision-table-properties",[yr(2,zj,{label:this.translate("Decision name"),className:"decision-table-name",value:t,ctrlForNewline:!0,onBlur:Hj,onChange:this.setDecisionTableName,elementId:"__decisionProperties_name",coords:"0:__decisionProperties"}),vr(1,"div","decision-table-header-separator"),yr(2,n)],4)}}Fj.$inject=["sheet","modeling","changeSupport","components","translate"];class zj extends vx{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),cv(this,uv)}render(){const e=this.props.value;return vr(1,"div",sv(this.getSelectionClasses(),this.getClassName()),this.getEditor(),0,{"data-element-id":this.props.elementId,"data-coords":this.props.coords,title:this._translate("Decision name: ")+e})}}function Qj(){return null}function Hj(e){e.target.scroll(0,0)}class Wj{constructor(e){e.onGetComponent("table.before",500,(()=>Fj))}}Wj.$inject=["components"];var Uj={__depends__:[wx],__init__:["decisionTableProperties"],decisionTableProperties:["type",Wj]};class Xj extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),av(this)}onChange=({aggregation:e,hitPolicy:t})=>{this.modeling.editHitPolicy(t,e)};onElementsChanged=()=>{this.forceUpdate()};componentDidMount(){this.changeSupport.onElementsChanged(this.getRoot().id,this.onElementsChanged)}componentWillUnmount(){this.changeSupport.offElementsChanged(this.getRoot().id,this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}render(){const e=this.getRoot().businessObject,{aggregation:t,hitPolicy:n}=e,i=h(Vv,(e=>function(e,t){return e.hitPolicy===t.hitPolicy&&e.aggregation===t.aggregation}(e.value,{aggregation:t,hitPolicy:n})));return vr(1,"div","hit-policy",[vr(1,"label","dms-label",this._translate("Hit policy:"),0),yr(2,Z$,{className:"hit-policy-edit-policy-select",label:this._translate("Hit policy"),onChange:this.onChange,options:Vv.map((e=>({...e,label:this._translate(e.label)}))),value:i.value,"data-hit-policy":"true",noInput:!0})],4,{title:this._translate(i.explanation)})}}function Kj(e){e.onGetComponent("hit-policy",(()=>Xj))}Xj.$inject=["changeSupport","sheet","modeling"],Kj.$inject=["components"];var Gj={__depends__:[Ux],__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Kj]};class Yj extends Gd{constructor(e,t){super(e),this.executed(["row.add","row.remove","col.add","col.remove"],Zj((e=>{var t=e.context,n=t.row||t.col;this.updateRoot(n,t.oldRoot)}))),this.reverted(["row.add","row.remove","col.add","col.remove"],Zj((e=>{var t=e.context,n=t.row||t.col;this.updateRoot(n,t.newRoot)})))}updateRoot(e,t){var n=e.root,i=e.businessObject;if(hn(e,"dmn:DecisionRule")){if(t){let e=t.businessObject.get("rule"),n=e.indexOf(i);e.splice(n,1),i.$parent=null}if(n){let t=n.businessObject,o=n.rows.indexOf(e);t.get("rule").splice(o,0,i),i.$parent=t,e.cells.forEach(((t,n)=>{this.wireCell(t,e,n)}))}}if(hn(e,"dmn:InputClause")||hn(e,"dmn:OutputClause")){let o,r;if(t){let n=t.businessObject,s=n.get("input"),a=n.get("output");if(hn(e,"dmn:InputClause")&&(o=s,r=s.indexOf(i)),hn(e,"dmn:OutputClause")&&(o=a,r=a.indexOf(i)),-1===r)throw new Error("inconsistent model: clause not in table");o.splice(r,1),i.$parent=null,e.cells.forEach(((e,n)=>{this.unwireCell(e,t.rows[n])}))}if(n){let t,o,r=n.businessObject,s=r.get("input"),a=r.get("output"),l=n.cols.indexOf(e);hn(e,"dmn:InputClause")&&(o=s,t=l),hn(e,"dmn:OutputClause")&&(o=a,t=l-s.length),o.splice(t,0,i),i.$parent=r,e.cells.forEach(((e,t)=>{this.wireCell(e,n.rows[t],l)}))}}}unwireCell(e,t){var n=e.businessObject;let i,o,r=t.businessObject,s=r.get("inputEntry"),a=r.get("outputEntry");if(hn(e,"dmn:UnaryTests")&&(i=s),hn(e,"dmn:LiteralExpression")&&(i=a),o=i.indexOf(n),-1===o)throw new Error("cell not in row");i.splice(o,1),n.$parent=null}wireCell(e,t,n){var i=e.businessObject;let o,r,s=t.businessObject,a=s.get("inputEntry"),l=s.get("outputEntry");i.$parent!==s&&(hn(e,"dmn:UnaryTests")&&(o=a,r=n),hn(e,"dmn:LiteralExpression")&&(o=l,r=n-a.length),o.splice(r,0,i),i.$parent=s)}}function Zj(e){return function(t){var n=t.context;hn(n.row||n.col,"dmn:DMNElement")&&e(t)}}Yj.$inject=["eventBus","sheet"];let Jj=class{constructor(e){this._model=e}create(e,t={}){var n=this._model.create(e,t||{});return hn(n,"dmn:InputClause")&&(t.inputExpression?n.inputExpression=t.inputExpression:(n.inputExpression=this.create("dmn:LiteralExpression",{typeRef:"string"}),n.inputExpression.$parent=n)),hn(n,"dmn:OutputClause")&&(n.typeRef=t.typeRef||"string"),(hn(n,"dmn:UnaryTests")||hn(n,"dmn:LiteralExpression"))&&(n.text=t.text||""),this._ensureId(n),n}_needsId(e){return hn(e,"dmn:DMNElement")}_ensureId(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))}};Jj.$inject=["moddle"];class eI extends Qm{constructor(e){super(),this._dmnFactory=e}create(e,t){const n=this._dmnFactory;let{businessObject:i,type:o,...r}=t;if(!i){if(!o){if("root"===e)o="dmn:DecisionTable";else if("cell"===e){let{col:e}=r;hn(e,"dmn:OutputClause")&&(o="dmn:LiteralExpression"),hn(e,"dmn:InputClause")&&(o="dmn:UnaryTests")}if(!o)throw new Error("cannot guess <type>")}i=n.create(o)}return super.create(e,{businessObject:i,id:i.id,...r})}}eI.$inject=["dmnFactory"];class tI{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){const t=this._sheet,n=this._elementFactory,i=t.getRoot();let{row:o,index:r}=e;return void 0===r&&(r=e.index=i.rows.length),e.newRoot=i,o.cells.length||i.cols.forEach(((e,t)=>{const i=n.create("cell",{row:o,col:e});o.cells[t]=i})),t.addRow(o,r),t.getRoot()}revert(e){const{row:t}=e,n=this._sheet;return n.removeRow(t),n.getRoot()}}tI.$inject=["sheet","elementFactory"];class nI{constructor(e){this._sheet=e}execute(e){const t=this._sheet,n=t.getRoot();let{row:i}=e;const o=e.oldIndex=n.rows.indexOf(i);if(e.oldRoot=i.root,-1===o)throw new Error(`row#${i.id} not in sheet`);return t.removeRow(i),t.getRoot()}revert(e){const{row:t,oldIndex:n}=e,i=this._sheet;return i.addRow(t,n),i.getRoot()}}nI.$inject=["sheet"];class iI{constructor(e){this._modeling=e}preExecute(e){let{row:t}=e;this._modeling.removeRow(t)}postExecute(e){let{row:t,index:n}=e;this._modeling.addRow(t,n)}}iI.$inject=["modeling"];class oI{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){const t=this._sheet,n=this._elementFactory,i=t.getRoot();let{col:o,index:r}=e;return void 0===r&&(r=e.index=i.cols.length),e.newRoot=i,o.cells.length||i.rows.forEach(((e,t)=>{const i=n.create("cell",{row:e,col:o});o.cells[t]=i})),t.addCol(o,r),t.getRoot()}revert(e){const{col:t}=e,n=this._sheet;return n.removeCol(t),n.getRoot()}}oI.$inject=["sheet","elementFactory"];class rI{constructor(e,t){this._sheet=e,this._elementFactory=t}execute(e){const t=this._sheet;let{col:n}=e;const i=e.oldRoot=n.root;if(-1===(e.oldIndex=i.cols.indexOf(n)))throw new Error(`col#${n.id} not in sheet`);return t.removeCol(n),t.getRoot()}revert(e){const{col:t,oldIndex:n}=e,i=this._sheet;return i.addCol(t,n),i.getRoot()}}rI.$inject=["sheet","elementFactory"];class sI{constructor(e){this._modeling=e}preExecute(e){let{col:t}=e;this._modeling.removeCol(t)}postExecute(e){let{col:t,index:n}=e;this._modeling.addCol(t,n)}}sI.$inject=["modeling"];class aI{execute(e){let{cell:t}=e;return t}revert(e){const{cell:t}=e;return t}}let lI=class e{constructor(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n,e.on("table.init",(()=>{!function(e,t){p(e,(function(e,n){t.registerHandler(n,e)}))}(this.getHandlers(),n)}))}getHandlers(){return e._getHandlers()}static _getHandlers(){return{"row.add":tI,"row.remove":nI,"row.move":iI,"col.add":oI,"col.remove":rI,"col.move":sI,"cell.edit":aI}}_create(e,t){return t instanceof Lm?t:this._elementFactory.create(e,t)}addRow(e,t){const n=this._create("row",e),i={row:n,index:t};return this._commandStack.execute("row.add",i),n}removeRow(e){this._commandStack.execute("row.remove",{row:e})}moveRow(e,t){const n={row:e,index:t};this._commandStack.execute("row.move",n)}addCol(e,t){const n=this._create("col",e),i={col:n,index:t};return this._commandStack.execute("col.add",i),n}removeCol(e){this._commandStack.execute("col.remove",{col:e})}moveCol(e,t){const n={col:e,index:t};this._commandStack.execute("col.move",n)}editCell(e,t){const n={cell:e,...t};this._commandStack.execute("cell.edit",n)}};lI.$inject=["eventBus","elementFactory","commandStack"];class cI{constructor(e,t,n){this._dmnFactory=e,this._moddle=t,this._modeling=n}execute(e){const{element:t,allowedValues:n}=e;return hn(t,"dmn:InputClause")?(t.inputValues?e.oldAllowedValues=t.inputValues.text:uI(n)||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),uI(n)?t.inputValues&&delete t.inputValues:t.inputValues.text=n.join(",")):(t.outputValues&&t?e.oldAllowedValues=t.outputValues.text:uI(n)||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),uI(n)?t.outputValues&&delete t.outputValues:t.outputValues.text=n.join(",")),t}revert(e){const{element:t,oldAllowedValues:n}=e;return hn(t,"dmn:InputClause")?n?(t.inputValues||(t.inputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.inputValues.text=n):delete t.inputValues:n?(t.outputValues||(t.outputValues=this._dmnFactory.create("dmn:UnaryTests",{text:""})),t.outputValues.text=n):delete t.outputValues,t}}function uI(e){return null===e}cI.$inject=["dmnFactory","moddle","modeling"];const hI="id";class dI{constructor(e,t){this._elementRegistry=e,this._moddle=t}execute(e){const{element:t,properties:n}=e,i=fn(t),{changed:o,oldProperties:r}=this.updateProperties(i,n);return e.oldProperties=r,[...o,t]}revert(e){const{element:t,oldProperties:n}=e;var i=fn(t),{changed:o}=this.updateProperties(i,n);return[...o,t]}updateProperties(e,t){const n=this._moddle.ids;return f(t,((t,i,o)=>{const r=e.get(o);if(pI(i)){if(!pI(r))throw new Error(`non-existing property <${o}>: cannot update values`);let{changed:e,oldProperties:n}=this.updateProperties(r,i);return{changed:[...t.changed,...e,r],oldProperties:{...t.oldProperties,[o]:n}}}var s;return o===hI&&(s=i,e[hI]!==s)&&(n.unclaim(e[hI]),this._elementRegistry.updateId(e,i),n.claim(i,e)),e.set(o,i),{changed:t.changed,oldProperties:{...t.oldProperties,[o]:r}}}),{changed:[],oldProperties:{}})}}function pI(e){return i(e)&&s(e)}dI.$inject=["elementRegistry","moddle"];class fI{constructor(e){this._moddle=e}execute(e){const t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)}revert(e){const t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)}}fI.$inject=["moddle"];let gI=class e extends lI{constructor(e,t,n,i){super(e,t,n),this._eventBus=e,this._elementFactory=t,this._commandStack=n,this._sheet=i}getHandlers(){return e._getHandlers()}static _getHandlers(){return M({},super._getHandlers(),{editAllowedValues:cI,"element.updateProperties":dI,"id.updateClaim":fI})}editDecisionTableName(e){const t={element:this._sheet.getRoot().businessObject.$parent,properties:{name:e}};this._commandStack.execute("element.updateProperties",t)}editDecisionTableId(e){const t={element:this._sheet.getRoot().businessObject.$parent,properties:{id:e}};this._commandStack.execute("element.updateProperties",t)}editHitPolicy(e,t){const n={element:this._sheet.getRoot().businessObject,properties:{hitPolicy:e,aggregation:t}};this._commandStack.execute("element.updateProperties",n)}updateProperties(e,t){const n={element:e,properties:t};this._commandStack.execute("element.updateProperties",n)}editInputExpression(e,t){const n={element:e,properties:t};this._commandStack.execute("element.updateProperties",n)}editOutputName(e,t){const n={element:e,properties:{name:t}};this._commandStack.execute("element.updateProperties",n)}editInputExpressionTypeRef(e,t){const n={element:e,properties:{typeRef:t}};this._commandStack.execute("element.updateProperties",n)}editOutputTypeRef(e,t){const n={element:e,properties:{typeRef:t}};this._commandStack.execute("element.updateProperties",n)}editCell(e,t){const n={element:e,properties:{text:t}};this._commandStack.execute("element.updateProperties",n)}editAnnotation(e,t){const n={element:e,properties:{description:t}};this._commandStack.execute("element.updateProperties",n)}editAllowedValues(e,t){const n={element:e,allowedValues:t};this._commandStack.execute("editAllowedValues",n)}editExpressionLanguage(e,t){const n={element:e,properties:{expressionLanguage:t}};this._commandStack.execute("element.updateProperties",n)}claimId(e,t){const n={id:e,element:t,claiming:!0};this._commandStack.execute("id.updateClaim",n)}unclaimId(e,t){const n={id:e,element:t};this._commandStack.execute("id.updateClaim",n)}};gI.$inject=["eventBus","elementFactory","commandStack","sheet"];class mI extends Gd{constructor(e,t,n){super(e),this._ids=t.ids,this._modeling=n,this.preExecute(["row.add","col.add"],(e=>{const t=e.context,n=t.row||t.col;this.claimId(n.businessObject),n.cells&&n.cells.forEach((e=>this.claimId(e.businessObject)))}))}claimId(e){e.id&&!this._ids.assigned(e.id)&&this._modeling.claimId(e.id,e),e.$descriptor.properties.forEach((t=>{const n=e[t.name];n&&(r(n)&&n.forEach((e=>this.claimId(e))),n.$type&&this.claimId(n))}))}}mI.$inject=["eventBus","moddle","modeling"];class vI extends Gd{constructor(e,t){super(e),this._modeling=t,this.preExecute(["row.remove","col.remove"],(e=>{const t=e.context,n=t.row||t.col;this.unclaimId(n.businessObject),n.cells&&n.cells.forEach((e=>this.unclaimId(e.businessObject)))}))}unclaimId(e){e.id&&this._modeling.unclaimId(e.id,e),e.$descriptor.properties.forEach((t=>{const n=e[t.name];n&&(r(n)&&n.forEach((e=>this.unclaimId(e))),n.$type&&this.unclaimId(n))}))}}vI.$inject=["eventBus","modeling"];var yI={__init__:["dmnUpdater","idChangeBehavior","nameChangeBehavior","modeling"],__depends__:[{__init__:["idClaimBehavior","idUnclaimBehavior"],idClaimBehavior:["type",mI],idUnclaimBehavior:["type",vI]},_p],dmnUpdater:["type",Yj],dmnFactory:["type",Jj],elementFactory:["type",eI],idChangeBehavior:["type",qp],nameChangeBehavior:["type",Vp],modeling:["type",gI]};class xI extends Ds{constructor(e,t){super(e,t),this.changeCellValue=this.changeCellValue.bind(this),this.onElementsChanged=this.onElementsChanged.bind(this)}onElementsChanged(){this.forceUpdate()}componentWillMount(){const{injector:e}=this.context,{cell:t}=this.props,n=this._changeSupport=this.context.changeSupport;this._modeling=e.get("modeling"),n.onElementsChanged(t.id,this.onElementsChanged)}componentWillUnmount(){const{cell:e}=this.props;this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}changeCellValue(e){const{cell:t}=this.props;this._modeling.editCell(t.businessObject,e)}render(){const{cell:e,rowIndex:t,row:n,col:i,colIndex:o}=this.props,r=hn(e,"dmn:UnaryTests"),s=e.businessObject;return yr(2,dv,{className:r?"input-cell":"output-cell",elementId:e.id,coords:`${t}:${o}`,"data-row-id":n.id,"data-col-id":i.id,children:yr(2,_I,{placeholder:r?"-":"",onChange:this.changeCellValue,value:s.text,businessObject:s})})}}let bI=class extends Ds{constructor(e,t){super(e,t),this.state={focussed:!1},this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}onFocus(){this.setState({focussed:!0})}onBlur(){this.setState({focussed:!1})}render(){const{focussed:e}=this.state;return vr(1,"div","feel-editor"+(e?" focussed":""),[e&&br(yr(2,U$,{...this.props,autoFocus:!0,onBlur:this.onBlur})),br(yr(2,gx,{...this.props,onInput:()=>{},onFocus:this.onFocus}))],0,{onClick:this.onFocus})}};class _I extends Ds{constructor(e,t){super(e,t),this._expressionLanguages=t.injector.get("expressionLanguages"),this._translate=t.injector.get("translate"),this._variableResolver=t.injector.get("variableResolver",!1)}isDefaultExpressionLanguage(e){const{expressionLanguage:t}=e,n=this.getDefaultExpressionLanguage().value;return!t||t===n}getDescription(e){return e.description}getExpressionLanguageLabel(e){const{expressionLanguage:t}=e,n=this.getDefaultExpressionLanguage();return this._expressionLanguages.getLabel(t)||n.label}isScript(){const{businessObject:e}=this.props,t=this.getDefaultExpressionLanguage();return!!this._isInputCell()&&(-1!==e.text.indexOf("\n")||e.expressionLanguage&&e.expressionLanguage!==t)}_isInputCell(){return hn(this.props.businessObject,"dmn:UnaryTests")}getDefaultExpressionLanguage(){const e=this._isInputCell()?"inputCell":"outputCell";return this._expressionLanguages.getDefault(e)}getEditor(){return this.isFEEL()?bI:gx}isFEEL(){return"feel"===this.getExpressionLanguage()}getExpressionLanguage(){const{businessObject:e}=this.props;return e.expressionLanguage||this.getDefaultExpressionLanguage().value}_getVariables(){const{businessObject:e}=this.props;return this._variableResolver&&this._variableResolver.getVariables(e)}_getLabel(){return this._isInputCell()?this._translate("Input"):this._translate("Output")}render(){const{businessObject:e,placeholder:t,value:n,onChange:i}=this.props,o=this.getDescription(e),r=this.isDefaultExpressionLanguage(e),s=this.getExpressionLanguageLabel(e),a=this.isScript(),l=this.getEditor(),u=this._getVariables();return vr(1,"div","cell-editor",[c(o)&&vr(1,"div","description-indicator"),yr(2,l,{label:this._getLabel(),className:a?"script-editor":"",ctrlForNewline:!0,onInput:i,value:n,placeholder:t,variables:u}),!r&&vr(1,"span","dms-badge dmn-expression-language",[vr(1,"span","dms-badge-icon dmn-icon-file-code"),vr(1,"span","dms-badge-label",s,0)],4,{title:this._translate("Expression language: {expressionLanguageLabel}",{expressionLanguageLabel:s})})],0)}}class wI{constructor(e){e.onGetComponent("cell",1500,(({cellType:e})=>{if("rule"===e)return xI}))}}wI.$inject=["components"];var CI={__depends__:[wx,qv],__init__:["decisionRulesEditor"],decisionRulesEditor:["type",wI]};class OI extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this.state={top:0,left:0,isVisible:!1,isDisabled:!1,selection:null},av(this);const{debounceInput:n}=this;this.onClick=this.onClick.bind(this),this.handleSelectionChanged=this.handleSelectionChanged.bind(this),this.hideAndShowDebounced=this.hideAndShowDebounced.bind(this),this.showDebounced=n(this.showDebounced.bind(this)),this.updatePosition=this.updatePosition.bind(this)}componentDidMount(){const{eventBus:e}=this;e.on("cellSelection.changed",this.handleSelectionChanged),e.on("commandStack.changed",this.updatePosition),e.on("sheet.scroll",this.hideAndShowDebounced)}componentWillUnmount(){const{eventBus:e}=this;e.off("cellSelection.changed",this.handleSelectionChanged),e.off("commandStack.changed",this.updatePosition),e.off("sheet.scroll",this.hideAndShowDebounced)}hideAndShowDebounced(){this.state.isVisible&&(this.hide(),this.showDebounced())}showDebounced(){this.show()}hide(e={}){this.setState({...e,isVisible:!1})}show(e={}){this.setState({...e,isVisible:!0}),this.updatePosition()}handleSelectionChanged({elementId:e}){const{elementRegistry:t,expressionLanguages:n,simpleMode:i}=this,o=t.get(e);if(!o||!i.canSimpleEdit(o))return void this.hide({isDisabled:!1,selection:null});const r=!function(e,t,n){return!t||t===function(e,t){if(dn(e.col))return t.getDefault("inputCell").value;if(pn(e.col))return t.getDefault("outputCell").value}(e,n)}(o,o.businessObject.expressionLanguage,n);this.show({isDisabled:r,selection:o})}updatePosition(){const{selection:e}=this.state,{node:t}=this;if(!e||!t)return;const{renderer:n}=this,i=n.getContainer(),o=i.getBoundingClientRect(),r=My(e.id,i).getBoundingClientRect(),s=this.node.getBoundingClientRect(),{scrollLeft:a,scrollTop:l}=function(e){const t=Bt(e,".tjs-table-container");if(!t)return{scrollTop:0,scrollLeft:0};const{scrollLeft:n,scrollTop:i}=t;return{scrollTop:i,scrollLeft:n}}(t),c={};r.left+r.width/2>o.width/2?c.left=-o.left+r.left-s.width+4+a+"px":c.left=-o.left+r.left+r.width-4+a+"px",r.top+r.height/2>o.height/2?c.top=-o.top+r.top-s.height+4+l+"px":c.top=-o.top+r.top-4+l+"px",M(this.node.style,c)}onClick(){const{eventBus:e}=this,{isDisabled:t}=this.state;if(t)return;const{selection:n}=this,i=n.get();i&&(e.fire("simpleMode.open",{element:i,node:My(i.id,this._container)}),this.hide())}render(){const{isDisabled:e,isVisible:t,top:n,left:i}=this.state,o=["simple-mode-button","no-deselect"];return e&&o.push("disabled"),t?vr(1,"div",o.join(" "),vr(1,"span","dmn-icon-edit"),2,{onClick:this.onClick,style:{top:n,left:i},title:e?this._translate("Editing not supported for set expression language"):this._translate("Edit")},null,(e=>this.node=e)):null}}OI.$inject=["debounceInput","elementRegistry","eventBus","expressionLanguages","renderer","selection","simpleMode"];class kI{constructor(e,t,n,i,o){this._providers=[],e.onGetComponent("table.before",(()=>OI)),i.on("simpleMode.open",(({element:e,node:n})=>{const{left:i,top:r,width:s,height:a}=n.getBoundingClientRect(),l=o.getContainer();t.open({x:i+l.parentNode.scrollLeft,y:r+l.parentNode.scrollTop,width:s,height:a},{contextMenuType:"simple-mode-edit",element:e,offset:{x:4,y:4}})})),i.on("cell.click",(e=>{const{event:t,node:o,id:r}=e;if(function(e){if(e.altKey)return!1;return e.ctrlKey||e.metaKey}(t)){const t=n.get(r);t&&i.fire("simpleMode.open",{node:o,element:t}),e.preventDefault()}}))}registerProvider(e){this._providers.push(e)}canSimpleEdit(e){return this._providers.reduce(((t,n)=>t||n(e)),!1)}}kI.$inject=["components","contextMenu","elementRegistry","eventBus","renderer"];var EI={__depends__:[Ux,jy,jv],__init__:["simpleMode"],simpleMode:["type",kI]};const SI="none";class RI extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=function(e){return!e||function(e){return""===e}(e)?"none":"true"===e.trim()?"true":"false"===e.trim()?"false":void 0}(n.businessObject.text);this.state={value:i||SI},this.editCell=this.editCell.bind(this),this.onChange=this.onChange.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onChange(e){const{element:t}=this.props.context;this.editCell(t.businessObject,e===SI?"":e),this.setState({value:e})}render(){const{value:e}=this.state,t=[{label:"-",value:SI},{label:this._translate("Yes"),value:"true"},{label:this._translate("No"),value:"false"}];return vr(1,"div","simple-boolean-edit context-menu-container",[vr(1,"h3","dms-heading",this._translate("Edit boolean"),0),vr(1,"h4","dms-heading",this._translate("Set value"),0),yr(2,Z$,{label:this._translate("Boolean value"),noInput:!0,className:"dms-block",onChange:this.onChange,options:t,value:e})],4)}}class TI{constructor(e,t){t.registerProvider((e=>(dn(e.col)||pn(e.col))&&"boolean"===MI(e))),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if("boolean"===MI(e.element))return RI}}))}}function MI(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}TI.$inject=["components","simpleMode"];var AI={__depends__:[yj,EI],__init__:["simpleBooleanEdit"],simpleBooleanEdit:["type",TI]};const PI=/^\d{4}(?:-\d\d){2}$/,DI=/^\[date\("([^"]*)"\)..date\("([^"]*)"\)\]$/,$I=/^(<|>)\s*date\("([^"]*)"\)$/,jI=/^date\("([^"]*)"\)$/;function II(e){if(!PI.test(e.trim()))return"Date must match pattern yyyy-MM-dd"}function BI(e,t){return"exact"===e?`date("${t[0]}")`:"before"===e?`< date("${t[0]}")`:"after"===e?`> date("${t[0]}")`:"between"===e?`[date("${t[0]}")..date("${t[1]}")]`:void 0}function LI(){const e=new Date;return e.setUTCHours(0,0,0,0),e.toISOString().slice(0,10)}function NI(e){if(!e||""===e.trim())return{type:"exact",date:""};let t=e.match(DI);return t?{type:"between",dates:[t[1],t[2]]}:(t=e.match($I),t?{type:"<"===t[1]?"before":"after",date:t[2]}:(t=e.match(jI),t?{type:"exact",date:t[1]}:void 0))}const qI="exact",VI="between";let FI=class extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=NI(n.businessObject.text);if(i){let e;e=i.date?[i.date,""]:i.dates?i.dates:["",""],this.state={type:i.type,dates:e}}else this.state={type:qI,dates:["",""]};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onTypeChange=this.onTypeChange.bind(this),this.onSetStartDateTodayClick=this.onSetStartDateTodayClick.bind(this),this.onSetEndDateTodayClick=this.onSetEndDateTodayClick.bind(this),this.onStartDateInput=this.onStartDateInput.bind(this),this.onEndDateInput=this.onEndDateInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onTypeChange(e){const{element:t}=this.props.context,{dates:n}=this.state;this.setState({type:e}),NI(BI(e,n))&&this.editCell(t.businessObject,BI(e,n))}onSetStartDateTodayClick(){const{element:e}=this.props.context,{dates:t,type:n}=this.state,i=LI();this.setState({dates:[i,t[1]]}),NI(BI(n,[i,t[1]]))&&this.editCell(e.businessObject,BI(n,[i,t[1]]))}onSetEndDateTodayClick(){const{element:e}=this.props.context,{dates:t,type:n}=this.state,i=LI();this.setState({dates:[t[0],i]}),NI(BI(n,[t[0],i]))&&this.editCell(e.businessObject,BI(n,[t[0],i]))}onStartDateInput({value:e}){const{element:t}=this.props.context,{dates:n,type:i}=this.state;this.setState({dates:[e,n[1]]}),this.debouncedEditCell(t.businessObject,BI(i,[e,n[1]]))}onEndDateInput({value:e}){const{element:t}=this.props.context,{dates:n,type:i}=this.state;this.setState({dates:[n[0],e]}),this.debouncedEditCell(t.businessObject,BI(i,[n[0],e]))}render(){const{dates:e,type:t}=this.state,n=[{label:this._translate("Exactly"),value:qI},{label:this._translate("Before"),value:"before"},{label:this._translate("After"),value:"after"},{label:this._translate("Between"),value:VI}];return vr(1,"div","context-menu-container simple-date-edit",[vr(1,"h3","dms-heading",this._translate("Edit date"),0),vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Test type"),noInput:!0,onChange:this.onTypeChange,options:n,value:t}),2),vr(1,"h4","dms-heading",t===VI?this._translate("Edit start date"):this._translate("Set date"),0),vr(1,"div",null,[yr(2,rj,{label:t===VI?this._translate("Start date"):this._translate("Date"),className:"start-date-input dms-block",onInput:this.onStartDateInput,placeholder:this._translate("e.g. { sample }",{sample:LI()}),validate:e=>II(e)&&this._translate(II(e)),value:e[0]}),vr(1,"p","dms-hint",[vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onSetStartDateTodayClick}),xr(".")],4)],4),t===VI&&vr(1,"h4","dms-heading",this._translate("Edit end date"),0),t===VI&&vr(1,"div",null,[yr(2,rj,{label:this._translate("End date"),className:"end-date-input dms-block",onInput:this.onEndDateInput,placeholder:this._translate("e.g. { sample }",{sample:LI()}),validate:e=>II(e)&&this._translate(II(e)),value:e[1]}),vr(1,"p","dms-hint",[vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onSetEndDateTodayClick}),xr(".")],4)],4)],0)}},zI=class extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=NI(n.businessObject.text);this.state={date:i?i.date:""};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onClick=this.onClick.bind(this),this.onInput=this.onInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onClick(){const{element:e}=this.props.context,t=LI();this.setState({date:t}),this.editCell(e.businessObject,`date("${t}")`)}onInput({value:e}){const{element:t}=this.props.context;this.setState({date:e}),this.debouncedEditCell(t.businessObject,`date("${e}")`)}render(){const{date:e}=this.state;return vr(1,"div","context-menu-container simple-date-edit",[vr(1,"h3","dms-heading",this._translate("Edit date"),0),vr(1,"h4","dms-heading",this._translate("Set date"),0),vr(1,"div",null,[yr(2,rj,{label:this._translate("Date value"),onInput:this.onInput,placeholder:this._translate("e.g. { example } ",{example:LI()}),validate:e=>II(e)&&this._translate(II(e)),value:e,className:"dms-block"}),vr(1,"p","dms-hint",vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onClick}),2)],4)],4)}},QI=class{constructor(e,t){t.registerProvider((e=>{const t=HI(e);return(dn(e.col)||pn(e.col))&&WI(t)})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if(WI(HI(e.element))){if(dn(e.element.col))return FI;if(pn(e.element.col))return zI}}}))}};function HI(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function WI(e){return"date"===e}QI.$inject=["components","simpleMode"];var UI={__depends__:[yj,EI],__init__:["simpleDateEdit"],simpleDateEdit:["type",QI]};const XI=/^\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d(?:Z|(?:[@+-][^")]+))?$/,KI=/^\[date and time\("([^"]*)"\)..date and time\("([^"]*)"\)\]$/,GI=/^(<|>)\s*date and time\("([^"]*)"\)$/,YI=/^date and time\("([^"]*)"\)$/;function ZI(e){if(!XI.test(e.trim()))return"Date and time must match pattern yyyy-MM-ddTHH:mm:ss[time zone]"}function JI(e,t){return"exact"===e?`date and time("${t[0]}")`:"before"===e?`< date and time("${t[0]}")`:"after"===e?`> date and time("${t[0]}")`:"between"===e?`[date and time("${t[0]}")..date and time("${t[1]}")]`:void 0}function eB(){const e=new Date;return e.setUTCHours(0,0,0,0),e.toISOString().replace(".000Z","Z")}function tB(e){if(!e||""===e.trim())return{type:"exact",date:""};let t=e.match(KI);return t?{type:"between",dates:[t[1],t[2]]}:(t=e.match(GI),t?{type:"<"===t[1]?"before":"after",date:t[2]}:(t=e.match(YI),t?{type:"exact",date:t[1]}:void 0))}const nB="exact",iB="between";class oB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=tB(n.businessObject.text);if(i){let e;e=i.date?[i.date,""]:i.dates?i.dates:["",""],this.state={type:i.type,dates:e}}else this.state={type:nB,dates:["",""]};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onTypeChange=this.onTypeChange.bind(this),this.onSetStartDateTodayClick=this.onSetStartDateTodayClick.bind(this),this.onSetEndDateTodayClick=this.onSetEndDateTodayClick.bind(this),this.onStartDateInput=this.onStartDateInput.bind(this),this.onEndDateInput=this.onEndDateInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onTypeChange(e){const{element:t}=this.props.context,{dates:n}=this.state;this.setState({type:e}),tB(JI(e,n))&&this.editCell(t.businessObject,JI(e,n))}onSetStartDateTodayClick(){const{element:e}=this.props.context,{dates:t,type:n}=this.state,i=eB();this.setState({dates:[i,t[1]]}),tB(JI(n,[i,t[1]]))&&this.editCell(e.businessObject,JI(n,[i,t[1]]))}onSetEndDateTodayClick(){const{element:e}=this.props.context,{dates:t,type:n}=this.state,i=eB();this.setState({dates:[t[0],i]}),tB(JI(n,[t[0],i]))&&this.editCell(e.businessObject,JI(n,[t[0],i]))}onStartDateInput({value:e}){const{element:t}=this.props.context,{dates:n,type:i}=this.state;this.setState({dates:[e,n[1]]}),this.debouncedEditCell(t.businessObject,JI(i,[e,n[1]]))}onEndDateInput({value:e}){const{element:t}=this.props.context,{dates:n,type:i}=this.state;this.setState({dates:[n[0],e]}),this.debouncedEditCell(t.businessObject,JI(i,[n[0],e]))}render(){const{dates:e,type:t}=this.state,n=[{label:this._translate("Exactly"),value:nB},{label:this._translate("Before"),value:"before"},{label:this._translate("After"),value:"after"},{label:this._translate("Between"),value:iB}];return vr(1,"div","context-menu-container simple-date-edit",[vr(1,"h3","dms-heading",this._translate("Edit date and time"),0),vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Test type"),noInput:!0,onChange:this.onTypeChange,options:n,value:t}),2),vr(1,"h4","dms-heading",t===iB?this._translate("Edit start date and time"):this._translate("Set date and time"),0),vr(1,"div",null,[yr(2,rj,{label:t===iB?this._translate("Start date and time"):this._translate("Date and time"),className:"start-date-input dms-block",onInput:this.onStartDateInput,placeholder:this._translate("e.g. { sample }",{sample:eB()}),validate:e=>ZI(e)&&this._translate(ZI(e)),value:e[0]}),vr(1,"p","dms-hint",vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onSetStartDateTodayClick}),2)],4),t===iB&&vr(1,"h4","dms-heading",this._translate("Edit end date and time"),0),t===iB&&vr(1,"div",null,[yr(2,rj,{label:this._translate("End date and time"),className:"end-date-input dms-block",onInput:this.onEndDateInput,placeholder:this._translate("e.g. { sample }",{sample:eB()}),validate:e=>ZI(e)&&this._translate(ZI(e)),value:e[1]}),vr(1,"p","dms-hint",vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onSetEndDateTodayClick}),2)],4)],0)}}class rB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=tB(n.businessObject.text);this.state={date:i?i.date:""};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onClick=this.onClick.bind(this),this.onInput=this.onInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onClick(){const{element:e}=this.props.context,t=eB();this.setState({date:t}),this.editCell(e.businessObject,`date and time("${t}")`)}onInput({value:e}){const{element:t}=this.props.context;this.setState({date:e}),this.debouncedEditCell(t.businessObject,`date and time("${e}")`)}render(){const{date:e}=this.state;return vr(1,"div","context-menu-container simple-date-edit",[vr(1,"h3","dms-heading",this._translate("Edit date and time"),0),vr(1,"h4","dms-heading",this._translate("Set date and time"),0),vr(1,"div",null,[yr(2,rj,{label:this._translate("Date and time value"),onInput:this.onInput,placeholder:this._translate("e.g. { sample }",{sample:eB()}),validate:e=>ZI(e)&&this._translate(ZI(e)),value:e,className:"dms-block"}),vr(1,"p","dms-hint",vr(1,"button","use-today",this._translate("Use today"),0,{type:"button",onClick:this.onClick}),2)],4)],4)}}let sB=class{constructor(e,t){t.registerProvider((e=>{const t=aB(e);return(dn(e.col)||pn(e.col))&&lB(t)})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if(lB(aB(e.element))){if(dn(e.element.col))return oB;if(pn(e.element.col))return rB}}}))}};function aB(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function lB(e){return"dateTime"===e}sB.$inject=["components","simpleMode"];var cB={__depends__:[yj,EI],__init__:["simpleDateTimeEdit"],simpleDateTimeEdit:["type",sB]};const uB={equals:"=",less:"<",lessEquals:"<=",greater:">",greaterEquals:">="};function hB(e){return y(uB).filter((t=>e===uB[t]))[0]}function dB(e){if(!e||function(e){return""===e}(e.trim()))return{type:"comparison",values:[]};const t=function(e){const t=gB(e);if(t)return{type:"comparison",operator:"equals",values:[t]};const{operator:n,value:i}=mB(/^(?<operator>=|(:?<|>)=?)\s*duration\("(?<value>[^"]*)"\)$/,e);if(n&&i)return{type:"comparison",values:[i],operator:hB(n)}}(e);if(t)return t;const n=function(e){const{start:t,end:n,firstValue:i,secondValue:o}=mB(/^(?<start>[[\]])duration\("(?<firstValue>[^"]*)"\)\.\.duration\("(?<secondValue>[^"]*)"\)(?<end>[[\]])$/,e);if(t&&n)return{type:"range",values:[i,o],start:"]"===t?"exclude":"include",end:"["===n?"exclude":"include"}}(e);return n||void 0}function pB(e,t){return"equals"===e?`duration("${t}")`:`${uB[e]} duration("${t}")`}function fB(e,t,n,i){return`${"exclude"===n?"]":"["}duration("${e}")..duration("${t}")${"exclude"===i?"[":"]"}`}function gB(e){const t=/^duration\("([^"]*)"\)$/.exec(e);return t&&t[1]}function mB(e,t){const{groups:n}=e.exec(t)||{groups:{}};return n}const vB={yearMonthDuration:"Must match PnYnM",dayTimeDuration:"Must match PnDTnH"};class yB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._type=e.type,this.onInput=this.onInput.bind(this),this.validate=this.validate.bind(this),this.state={value:e.value}}onInput({value:e}){this.setState({value:e}),this.props.onInput(e)}validate(e){if(!function(e,t){return"yearMonthDuration"===e?function(e){return/^P(\d+Y\d+M|\d+Y|\d+M)$/.test(e)}(t):"dayTimeDuration"===e?function(e){return/^P(\d+DT\d+H|\d+D|T\d+H)$/.test(e)}(t):void 0}(this._type,e))return this._translate(vB[this._type])}_getPlaceholder(){if("yearMonthDuration"===this._type)return this._translate("e.g. { sample }",{sample:"P1Y2M"});"dayTimeDuration"===this._type&&this._translate("e.g. { sample }",{sample:"P1DT2H"})}render(){return yr(2,rj,{label:this.props.label,type:"text",onInput:this.onInput,placeholder:this._getPlaceholder(),validate:this.validate,value:this.state.value,className:this.props.className})}}const xB="comparison",bB="range";class _B extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context;this._type=function(e){return e.col.businessObject.inputExpression.typeRef}(n);const i=dB(n.businessObject.text,this._type);this.state=i?{type:i.type,comparisonOperator:i.operator||"equals",startValue:i.values[0]||"",endValue:i.values[1]||"",rangeStartType:i.start||"include",rangeEndType:i.end||"include"}:{type:xB,comparisonOperator:"equals",startValue:"",endValue:"",rangeStartType:"include",rangeEndType:"include"};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onComparisonOperatorChange=this.onComparisonOperatorChange.bind(this),this.onComparisonValueChange=this.onComparisonValueChange.bind(this),this.onTypeChange=this.onTypeChange.bind(this),this.onRangeStartTypeChange=this.onRangeStartTypeChange.bind(this),this.onRangeStartValueChange=this.onRangeStartValueChange.bind(this),this.onRangeEndTypeChange=this.onRangeEndTypeChange.bind(this),this.onRangeEndValueChange=this.onRangeEndValueChange.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onTypeChange(e){const{element:t}=this.props.context,{comparisonOperator:n,startValue:i,endValue:o,rangeStartType:r,rangeEndType:s}=this.state;e===xB?this.editCell(t.businessObject,pB(n,i)):this.editCell(t.businessObject,fB(i,o,r,s)),this.setState({type:e})}onComparisonOperatorChange(e){const{element:t}=this.props.context,{type:n,startValue:i}=this.state;n===xB&&(this.editCell(t.businessObject,pB(e,i)),this.setState({comparisonOperator:e}))}onComparisonValueChange(e){const{element:t}=this.props.context,{type:n,comparisonOperator:i}=this.state;n===xB&&(this.debouncedEditCell(t.businessObject,pB(i,e)),this.setState({startValue:e}))}onRangeStartTypeChange(e){const{element:t}=this.props.context,{type:n,startValue:i,endValue:o,rangeEndType:r}=this.state;n===bB&&(this.editCell(t.businessObject,fB(i,o,e,r)),this.setState({rangeStartType:e}))}onRangeStartValueChange(e){const{element:t}=this.props.context,{type:n,endValue:i,rangeStartType:o,rangeEndType:r}=this.state;n===bB&&(this.editCell(t.businessObject,fB(e,i,o,r)),this.setState({startValue:e}))}onRangeEndTypeChange(e){const{element:t}=this.props.context,{type:n,startValue:i,endValue:o,rangeStartType:r}=this.state;n===bB&&(this.editCell(t.businessObject,fB(i,o,r,e)),this.setState({rangeEndType:e}))}onRangeEndValueChange(e){const{element:t}=this.props.context,{type:n,startValue:i,rangeStartType:o,rangeEndType:r}=this.state;n===bB&&(this.editCell(t.businessObject,fB(i,e,o,r)),this.setState({endValue:e}))}renderComparison(e,t){const n=[{label:this._translate("Equals"),value:"equals"},{label:this._translate("Less"),value:"less"},{label:this._translate("Less or equals"),value:"lessEquals"},{label:this._translate("Greater"),value:"greater"},{label:this._translate("Greater or equals"),value:"greaterEquals"}];return vr(1,"div","comparison",[vr(1,"h4","dms-heading",xr("Value"),2),vr(1,"div","dms-fill-row dms-input-duration-edit-row",[yr(2,Z$,{label:this._translate("Comparison operator"),noInput:!0,onChange:this.onComparisonOperatorChange,options:n,value:e}),xr(" "),yr(2,yB,{label:this._translate("Duration value"),type:this._type,className:"comparison-duration-input",onInput:this.onComparisonValueChange,value:t})],4)],4)}renderRange(e,t,n,i){const o=[{label:this._translate("Include"),value:"include"},{label:this._translate("Exclude"),value:"exclude"}];return vr(1,"div","range",[vr(1,"h4","dms-heading",this._translate("Start value"),0),vr(1,"div","dms-fill-row dms-input-duration-edit-row",[yr(2,Z$,{label:this._translate("Range start operator"),noInput:!0,onChange:this.onRangeStartTypeChange,options:o,value:n}),xr(" "),yr(2,yB,{label:this._translate("Range start value"),type:this._type,className:"range-start-duration-input",onInput:this.onRangeStartValueChange,value:e})],4),vr(1,"h4","dms-heading",this._translate("End value"),0),vr(1,"div","dms-fill-row dms-input-duration-edit-row",[yr(2,Z$,{label:this._translate("Range end operator"),noInput:!0,onChange:this.onRangeEndTypeChange,options:o,value:i}),xr(" "),yr(2,yB,{label:this._translate("Range end value"),type:this._type,className:"range-end-duration-input",onInput:this.onRangeEndValueChange,value:t})],4)],4)}render(){const{type:e,comparisonOperator:t,startValue:n,endValue:i,rangeStartType:o,rangeEndType:r}=this.state,s=[{label:this._translate("Comparison"),value:xB},{label:this._translate("Range"),value:bB}];return vr(1,"div","context-menu-container simple-duration-edit",[vr(1,"h3","dms-heading",this._translate("Edit duration"),0),vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Test type"),noInput:!0,onChange:this.onTypeChange,options:s,value:e}),2),e===xB&&this.renderComparison(t,n),e===bB&&this.renderRange(n,i,o,r)],0)}}class wB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context;this._type=function(e){return e.col.businessObject.typeRef}(n);const i=t.injector.get("debounceInput");this.debouncedEditCell=i(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onInput=this.onInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onInput(e){const{element:t}=this.props.context;this.debouncedEditCell(t.businessObject,`duration("${e}")`)}render(){const e=gB(this.props.context.element.businessObject.text,this._type);return vr(1,"div","context-menu-container simple-duration-edit",[vr(1,"h3","dms-heading",this._translate("Edit duration"),0),vr(1,"h4","dms-heading",this._translate("Set duration"),0),yr(2,yB,{label:this._translate("Duration value"),onInput:this.onInput,value:e,type:this._type,className:"dms-block"})],4)}}class CB{constructor(e,t){t.registerProvider((e=>{const t=OB(e);return(dn(e.col)||pn(e.col))&&EB(t)})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if(EB(OB(e.element))){if(dn(e.element.col))return _B;if(pn(e.element.col))return wB}}}))}}function OB(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}CB.$inject=["components","simpleMode"];const kB=["yearMonthDuration","dayTimeDuration"];function EB(e){return kB.includes(e)}var SB={__depends__:[yj,EI],__init__:["simpleDurationEdit"],simpleDurationEdit:["type",CB]};const RB=/^(-?(?:[0-9]|\.[0-9])+)$|^((?:<|>|=){0,2})\s*(-?(?:[0-9]|\.[0-9])+)$/,TB=/^(\[|\]){1}(-?(?:[0-9]|\.[0-9])+){1,}\.\.(-?(?:[0-9]|\.[0-9])+){1,}(\[|\]){1}$/,MB={equals:"=",less:"<",lessEquals:"<=",greater:">",greaterEquals:">="};function AB(e){return y(MB).filter((t=>e===MB[t]))[0]}function PB(e){if(!e||function(e){return""===e}(e.trim()))return{type:"comparison"};const t=e.match(RB),n=e.match(TB);if(t){if(function(e){return e[0]&&e[1]&&!e[2]&&!e[3]}(t))return{type:"comparison",value:parseFloat(t[1]),operator:"equals"};if(function(e){return e[0]&&!e[1]&&e[2]&&e[3]}(t))return{type:"comparison",value:parseFloat(t[3]),operator:AB(t[2])}}else if(n)return{type:"range",values:[n[2],n[3]].map((e=>parseFloat(e))),start:"]"===n[1]?"exclude":"include",end:"["===n[4]?"exclude":"include"}}function DB(e,t){return"equals"===e?`${t}`:`${MB[e]} ${t}`}function $B(e,t,n,i){return`${"exclude"===n?"]":"["}${e}..${t}${"exclude"===i?"[":"]"}`}const jB="comparison",IB="range";class BB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=PB(n.businessObject.text);this.state=i?{type:i.type,comparisonOperator:i.operator||"equals",comparisonValue:i.value||0,rangeStartValue:i.values?i.values[0]:0,rangeEndValue:i.values?i.values[1]:0,rangeStartType:i.start||"include",rangeEndType:i.end||"include"}:{type:jB,comparisonOperator:"equals",comparisonValue:0,rangeStartValue:0,rangeEndValue:0,rangeStartType:"include",rangeEndType:"include"};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onComparisonOperatorChange=this.onComparisonOperatorChange.bind(this),this.onComparisonValueChange=this.onComparisonValueChange.bind(this),this.onTypeChange=this.onTypeChange.bind(this),this.onRangeStartTypeChange=this.onRangeStartTypeChange.bind(this),this.onRangeStartValueChange=this.onRangeStartValueChange.bind(this),this.onRangeEndTypeChange=this.onRangeEndTypeChange.bind(this),this.onRangeEndValueChange=this.onRangeEndValueChange.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onTypeChange(e){const{element:t}=this.props.context,{comparisonOperator:n,comparisonValue:i,rangeStartValue:o,rangeEndValue:r,rangeStartType:s,rangeEndType:a}=this.state;e===jB?this.editCell(t.businessObject,DB(n,i)):this.editCell(t.businessObject,$B(o,r,s,a)),this.setState({type:e})}onComparisonOperatorChange(e){const{element:t}=this.props.context,{type:n,comparisonValue:i}=this.state;n===jB&&(this.editCell(t.businessObject,DB(e,i)),this.setState({comparisonOperator:e}))}onComparisonValueChange(e){const{element:t}=this.props.context,{type:n,comparisonOperator:i}=this.state;n===jB&&(this.debouncedEditCell(t.businessObject,DB(i,e)),this.setState({comparisonValue:e}))}onRangeStartTypeChange(e){const{element:t}=this.props.context,{type:n,rangeStartValue:i,rangeEndValue:o,rangeEndType:r}=this.state;n===IB&&(this.editCell(t.businessObject,$B(i,o,e,r)),this.setState({rangeStartType:e}))}onRangeStartValueChange(e){const{element:t}=this.props.context,{type:n,rangeEndValue:i,rangeStartType:o,rangeEndType:r}=this.state;n===IB&&(this.editCell(t.businessObject,$B(e,i,o,r)),this.setState({rangeStartValue:e}))}onRangeEndTypeChange(e){const{element:t}=this.props.context,{type:n,rangeStartValue:i,rangeEndValue:o,rangeStartType:r}=this.state;n===IB&&(this.editCell(t.businessObject,$B(i,o,r,e)),this.setState({rangeEndType:e}))}onRangeEndValueChange(e){const{element:t}=this.props.context,{type:n,rangeStartValue:i,rangeStartType:o,rangeEndType:r}=this.state;n===IB&&(this.editCell(t.businessObject,$B(i,e,o,r)),this.setState({rangeEndValue:e}))}renderComparison(e,t){const n=[{label:this._translate("Equals"),value:"equals"},{label:this._translate("Less"),value:"less"},{label:this._translate("Less or equals"),value:"lessEquals"},{label:this._translate("Greater"),value:"greater"},{label:this._translate("Greater or equals"),value:"greaterEquals"}];return vr(1,"div","comparison",[vr(1,"h4","dms-heading",this._translate("Value"),0),vr(1,"div","dms-fill-row",[yr(2,Z$,{label:this._translate("Comparison operator"),noInput:!0,onChange:this.onComparisonOperatorChange,options:n,value:e}),xr(" "),yr(2,hb,{label:this._translate("Value"),className:"comparison-number-input",onInput:this.onComparisonValueChange,type:"number",value:t})],4)],4)}renderRange(e,t,n,i){const o=[{label:this._translate("Include"),value:"include"},{label:this._translate("Exclude"),value:"exclude"}];return vr(1,"div","range",[vr(1,"h4","dms-heading",this._translate("Start value"),0),vr(1,"div","dms-fill-row",[yr(2,Z$,{label:this._translate("Start value"),noInput:!0,onChange:this.onRangeStartTypeChange,options:o,value:n}),xr(" "),yr(2,hb,{className:"range-start-number-input",onInput:this.onRangeStartValueChange,type:"number",value:e})],4),vr(1,"h4","dms-heading",this._translate("End value"),0),vr(1,"div","dms-fill-row",[yr(2,Z$,{label:this._translate("End value"),noInput:!0,onChange:this.onRangeEndTypeChange,options:o,value:i}),xr(" "),yr(2,hb,{className:"range-end-number-input",onInput:this.onRangeEndValueChange,type:"number",value:t})],4)],4)}render(){const{type:e,comparisonOperator:t,comparisonValue:n,rangeStartValue:i,rangeEndValue:o,rangeStartType:r,rangeEndType:s}=this.state,a=[{label:this._translate("Comparison"),value:jB},{label:this._translate("Range"),value:IB}];return vr(1,"div","context-menu-container simple-number-edit",[vr(1,"h3","dms-heading",this._translate("Edit number"),0),vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Test type"),noInput:!0,onChange:this.onTypeChange,options:a,value:e}),2),e===jB&&this.renderComparison(t,n),e===IB&&this.renderRange(i,o,r,s)],0)}}class LB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=PB(n.businessObject.text);this.state=i?{value:i.value}:{value:""};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onInput=this.onInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onInput(e){const{element:t}=this.props.context;this.debouncedEditCell(t.businessObject,e),this.setState({value:e})}render(){const{value:e}=this.state;return vr(1,"div","context-menu-container simple-number-edit",[vr(1,"h3","dms-heading",this._translate("Edit number"),0),vr(1,"h4","dms-heading",this._translate("Set value"),0),yr(2,hb,{onInput:this.onInput,type:"number",value:e})],4)}}class NB{constructor(e,t){t.registerProvider((e=>{const t=qB(e);return(dn(e.col)||pn(e.col))&&FB(t)})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if(FB(qB(e.element))){if(dn(e.element.col))return BB;if(pn(e.element.col))return LB}}}))}}function qB(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}NB.$inject=["components","simpleMode"];const VB=["number","integer","long","double"];function FB(e){return VB.includes(e)}var zB={__depends__:[yj,EI],__init__:["simpleNumberEdit"],simpleNumberEdit:["type",NB]};function QB(e){if(!e||HB(e.trim()))return{type:"disjunction",values:[]};let t=e.split(",");const n={type:"disjunction",values:[]};let i="";if(t.forEach((e=>{i+=e,/^"[^"]*"$/.test(i.trim())?(n.values.push(i.trim()),i=""):i+=","})),!i)return n;n.type="negation",n.values=[],i="";const o=e.match(/^\s*not\((.*)\)\s*$/);return o&&(t=o[1].split(","),t.forEach((e=>{i+=e,/^"[^"]*"$/.test(i.trim())?(n.values.push(i.trim()),i=""):i+=","})),!i)?n:void 0}function HB(e){return""===e}const WB="disjunction",UB="negation";class XB extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");let n=QB(e.context.element.businessObject.text);n||(n={values:[],type:WB});const i=function(e){const t=dn(e)?e.inputValues:e.outputValues;return!t||HB(t.text)?[]:t.text.split(",").map((e=>e.trim()))}(e.context.element.col.businessObject),o=n.values.filter((e=>!GB(i,e))),r=dn(e.context.element.col);let s=i.map((e=>({value:e,isChecked:GB(n.values,e),isRemovable:!1,group:this._translate("Predefined values")})));r&&(s=s.concat(o.map((e=>({value:e,isChecked:!0,isRemovable:!0,group:this._translate("Custom values")})))));let a="";r||!n.values.length||GB(i,n.values[0])||(a=n.values[0]),this.state={items:s,unaryTestsType:n.type,inputValue:a,isOutputValueInputChecked:""!==a};const l=t.injector.get("debounceInput");this.debouncedEditCell=l(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.addUnaryTestsListItem=this.addUnaryTestsListItem.bind(this),this.onInput=this.onInput.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onOutputValueInputClick=this.onOutputValueInputClick.bind(this),this.onUnaryTestsListChanged=this.onUnaryTestsListChanged.bind(this),this.onUnaryTestsTypeChange=this.onUnaryTestsTypeChange.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onUnaryTestsTypeChange(e){const{items:t}=this.state,n=KB(t),{element:i}=this.props.context;e===WB?(this.editCell(i.businessObject,n.join(",")),this.setState({unaryTestsType:WB})):(this.editCell(i.businessObject,`not(${n.join(",")})`),this.setState({unaryTestsType:UB}))}onUnaryTestsListChanged(e){const t=KB(e),{element:n}=this.props.context,{unaryTestsType:i}=this.state;i===WB?this.editCell(n.businessObject,t.join(",")):this.editCell(n.businessObject,`not(${t.join(",")})`),this.setState({items:e,isOutputValueInputChecked:!1})}onOutputValueInputClick(){const{element:e}=this.props.context,{inputValue:t,items:n}=this.state,i=QB(t);!i||i.values.length>1||(this.editCell(e.businessObject,`${i.values.join("")}`),this.setState({items:n.map((e=>(e.isChecked=!1,e))),isOutputValueInputChecked:!0}))}onInput({isValid:e,value:t}){const{isOutputValueInputChecked:n}=this.state;this.setState({inputValue:t});const{element:i}=this.props.context;!dn(i)&&e&&n&&this.debouncedEditCell(i.businessObject,t)}onKeyDown({isValid:e,event:t}){if(13!==t.keyCode)return;const{element:n}=this.props.context,i=dn(n.col);!i&&e||(t.stopPropagation(),t.preventDefault()),e&&(i?this.addUnaryTestsListItem():this.onOutputValueInputClick())}addUnaryTestsListItem(){const{inputValue:e,items:t,unaryTestsType:n}=this.state,i=QB(e);if(!i)return;const{element:o}=this.props.context,r=KB(t),s=[].concat(r,i.values);n===WB?this.editCell(o.businessObject,s.join(",")):this.editCell(o.businessObject,`not(${s.join(",")})`);const a=t.concat(i.values.map((e=>({value:e,isChecked:!0,isRemovable:!0,group:this._translate("Custom values")}))));this.setState({items:a,inputValue:""})}render(){const{element:e}=this.props.context,{inputValue:t,isOutputValueInputChecked:n,items:i,unaryTestsType:o}=this.state,r=[{label:this._translate("Match one"),value:WB},{label:this._translate("Match none"),value:UB}],s=dn(e.col),a=o===UB,l=!s&&i.length>0;return vr(1,"div","simple-string-edit context-menu-container",[vr(1,"h3","dms-heading",this._translate("Edit string"),0),s&&vr(1,"p",null,yr(2,Z$,{label:this._translate("String value"),noInput:!0,onChange:this.onUnaryTestsTypeChange,options:r,value:a?UB:WB},null,(e=>this.selectNode=e)),2),yr(2,oj,{onChange:this.onUnaryTestsListChanged,items:i,type:s?"checkbox":"radio"}),vr(1,"h4","dms-heading",s?this._translate("Add values"):this._translate("Set value"),0),vr(1,"div","dms-fill-row",[l&&vr(64,"input","cursor-pointer",null,1,{checked:n,onClick:this.onOutputValueInputClick,type:"radio",style:{marginRight:"8px"}}),yr(2,rj,{label:s?this._translate("Values"):this._translate("Value"),className:"dms-block",onKeyDown:this.onKeyDown,onInput:this.onInput,placeholder:s?this._translate('"value", "value", ...'):this._translate('"value"'),type:"text",validate:e=>{if(!QB(e))return this._translate("Strings must be in double quotes")},value:t})],0)],0)}}function KB(e){return e.filter((e=>e.isChecked)).map((e=>e.value))}function GB(e,t){return-1!==e.indexOf(t)}class YB{constructor(e,t){t.registerProvider((e=>(dn(e.col)||pn(e.col))&&"string"===ZB(e))),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if("string"===ZB(e.element))return XB}}))}}function ZB(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}YB.$inject=["components","simpleMode"];var JB={__depends__:[yj,EI],__init__:["simpleStringEdit"],simpleStringEdit:["type",YB]};const eL=/^(?:\d\d:){2}\d\d(?:Z|(?:[@+-][^")]+))?$/,tL=/^\[time\("([^"]*)"\)..time\("([^"]*)"\)\]$/,nL=/^(<|>)\s*time\("([^"]*)"\)$/,iL=/^time\("([^"]*)"\)$/;function oL(e){if(!eL.test(e.trim()))return"Time must match pattern hh:mm:ss[time zone]"}function rL(e,t){return"exact"===e?`time("${t[0]}")`:"before"===e?`< time("${t[0]}")`:"after"===e?`> time("${t[0]}")`:"between"===e?`[time("${t[0]}")..time("${t[1]}")]`:void 0}function sL(){return(new Date).toISOString().slice(11,-5)+"Z"}function aL(e){if(!e||""===e.trim())return{type:"exact",time:""};let t=e.match(tL);return t?{type:"between",times:[t[1],t[2]]}:(t=e.match(nL),t?{type:"<"===t[1]?"before":"after",time:t[2]}:(t=e.match(iL),t?{type:"exact",time:t[1]}:void 0))}const lL="exact",cL="between";class uL extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=aL(n.businessObject.text);if(i){let e;e=i.time?[i.time,""]:i.times?i.times:["",""],this.state={type:i.type,times:e}}else this.state={type:lL,times:["",""]};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onTypeChange=this.onTypeChange.bind(this),this.onSetStartTimeNowClick=this.onSetStartTimeNowClick.bind(this),this.onSetEndTimeNowClick=this.onSetEndTimeNowClick.bind(this),this.onStartTimeInput=this.onStartTimeInput.bind(this),this.onEndTimeInput=this.onEndTimeInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onTypeChange(e){const{element:t}=this.props.context,{times:n}=this.state;this.setState({type:e}),aL(rL(e,n))&&this.editCell(t.businessObject,rL(e,n))}onSetStartTimeNowClick(){const{element:e}=this.props.context,{times:t,type:n}=this.state,i=sL();this.setState({times:[i,t[1]]}),aL(rL(n,[i,t[1]]))&&this.editCell(e.businessObject,rL(n,[i,t[1]]))}onSetEndTimeNowClick(){const{element:e}=this.props.context,{times:t,type:n}=this.state,i=sL();this.setState({times:[t[0],i]}),aL(rL(n,[t[0],i]))&&this.editCell(e.businessObject,rL(n,[t[0],i]))}onStartTimeInput({value:e}){const{element:t}=this.props.context,{times:n,type:i}=this.state;this.setState({times:[e,n[1]]}),this.debouncedEditCell(t.businessObject,rL(i,[e,n[1]]))}onEndTimeInput({value:e}){const{element:t}=this.props.context,{times:n,type:i}=this.state;this.setState({times:[n[0],e]}),this.debouncedEditCell(t.businessObject,rL(i,[n[0],e]))}render(){const{times:e,type:t}=this.state,n=[{label:this._translate("Exactly"),value:lL},{label:this._translate("Before"),value:"before"},{label:this._translate("After"),value:"after"},{label:this._translate("Between"),value:cL}];return vr(1,"div","context-menu-container simple-time-edit",[vr(1,"h3","dms-heading",this._translate("Edit time"),0),vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Time"),noInput:!0,onChange:this.onTypeChange,options:n,value:t}),2),vr(1,"h4","dms-heading",t===cL?this._translate("Edit start time"):this._translate("Set time"),0),vr(1,"div",null,[yr(2,rj,{label:this._translate("Start time"),className:"start-time-input dms-block",onInput:this.onStartTimeInput,placeholder:this._translate("e.g. { example } ",{example:LI()}),validate:e=>oL(e)&&this._translate(oL(e)),value:e[0]}),vr(1,"p","dms-hint",[vr(1,"button","use-now",this._translate("Use now"),0,{type:"button",onClick:this.onSetStartTimeNowClick}),xr(".")],4)],4),t===cL&&vr(1,"h4","dms-heading",this._translate("Edit end time"),0),t===cL&&vr(1,"div",null,[yr(2,rj,{label:this._translate("End time"),className:"end-time-input dms-block",onInput:this.onEndTimeInput,placeholder:this._translate("e.g. { example } ",{example:LI()}),validate:e=>oL(e)&&this._translate(oL(e)),value:e[1]}),vr(1,"p","dms-hint",[vr(1,"button","use-now",this._translate("Use now"),0,{type:"button",onClick:this.onSetEndTimeNowClick}),xr(".")],4)],4)],0)}}class hL extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._modeling=t.injector.get("modeling");const{element:n}=this.props.context,i=aL(n.businessObject.text);this.state={date:i?i.date:""};const o=t.injector.get("debounceInput");this.debouncedEditCell=o(this.editCell.bind(this)),this.editCell=this.editCell.bind(this),this.onClick=this.onClick.bind(this),this.onInput=this.onInput.bind(this)}editCell(e,t){this._modeling.editCell(e,t)}onClick(){const{element:e}=this.props.context,t=sL();this.setState({date:t}),this.editCell(e.businessObject,`time("${t}")`)}onInput({value:e}){const{element:t}=this.props.context;this.setState({date:e}),this.debouncedEditCell(t.businessObject,`time("${e}")`)}render(){const{date:e}=this.state;return vr(1,"div","context-menu-container simple-time-edit",[vr(1,"h3","dms-heading",this._translate("Edit time"),0),vr(1,"h4","dms-heading",this._translate("Set time"),0),vr(1,"div",null,[yr(2,rj,{label:this._translate("Time value"),onInput:this.onInput,placeholder:this._translate("e.g. { example } ",{example:LI()}),validate:e=>oL(e)&&this._translate(oL(e)),value:e,className:"dms-block"}),vr(1,"p","dms-hint",[vr(1,"button","use-now",this._translate("Use now"),0,{type:"button",onClick:this.onClick}),xr(".")],4)],4)],4)}}class dL{constructor(e,t){t.registerProvider((e=>{const t=pL(e);return(dn(e.col)||pn(e.col))&&fL(t)})),e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"simple-mode-edit"===e.contextMenuType){if(!e.element)return;if(fL(pL(e.element))){if(dn(e.element.col))return uL;if(pn(e.element.col))return hL}}}))}}function pL(e){return dn(e.col)?e.col&&e.col.businessObject.inputExpression.typeRef:e.col&&e.col.businessObject.typeRef}function fL(e){return"time"===e}dL.$inject=["components","simpleMode"];var gL={__depends__:[yj,EI],__init__:["simpleTimeEdit"],simpleTimeEdit:["type",dL]};class mL extends Ds{constructor(e,t){super(e,t),av(this)}componentDidMount(){const e=this.getRoot();this.changeSupport.onElementsChanged(e,this.onElementsChanged)}componentWillUnmount(){const e=this.getRoot();this.changeSupport.offElementsChanged(e,this.onElementsChanged)}getRoot(){return this.sheet.getRoot()}onElementsChanged=()=>{this.forceUpdate()};handleMouseDown=e=>{!function({node:e,event:t,minWidth:n,onEnd:i=vL}){t.preventDefault();const o=e.getBoundingClientRect().width,r=t.clientX;let s;function a(t){t.preventDefault();const n=c(t.clientX);s&&cancelAnimationFrame(s),s=requestAnimationFrame((()=>{e.style.width=n+"px"}))}function l(e){e.preventDefault(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l);const t=c(e.clientX);i(t)}function c(e){const t=e-r;return Math.max(o+t,n)}document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)}({node:Bt(e.target,"th",!1),event:e,minWidth:this.props.minWidth||150,onEnd:this.saveWidth})};saveWidth=e=>{const{col:t}=this.props,n={};hn(t,"dmn:DecisionTable")?n.annotationsWidth=e:n.width=e,this.modeling.updateProperties(t,n)};isLastInputOrOutput(){const{col:e}=this.props,t=fn(this.getRoot());if(hn(e,"dmn:InputClause")){const n=t.get("input");return n.indexOf(e)===n.length-1}if(hn(e,"dmn:OutputClause")){const n=t.get("output");return n.indexOf(e)===n.length-1}}render(){const e=this.isLastInputOrOutput()?{right:"-7px",width:"27px"}:null;return vr(1,"div","resize-column-handle",null,1,{onMouseDown:this.handleMouseDown,title:this.translate("Resize"),style:e})}}function vL(){}function yL(e){e.onGetComponent("cell-inner",((e={})=>{const{cellType:t}=e;if("input-cell"===t||"output-cell"===t||"annotations"===t)return mL}))}mL.$inject=["sheet","changeSupport","translate","modeling"],yL.$inject=["components"];var xL={__init__:["columnResizeProvider"],columnResizeProvider:["type",yL]};let bL=class e extends Yv{getModules(){return[...Yv._getModules(),...e._getModules()]}static _getModules(){return[lx,Cx,jy,Ux,Jy,Yx,tb,ob,cb,ax,xj,xL,Dj,Nj,Vj,jv,yj,Uj,sx,Gj,ry,yI,CI,ny,EI,AI,UI,cB,SB,zB,JB,gL,Bm]}};class _L{constructor(e){this._listeners={},e.on("elements.changed",(({elements:e})=>{this.elementsChanged(e)})),e.on("element.updateId",(({element:e,newId:t})=>{this.updateId(e.id,t)}))}elementsChanged(e){const t={},n=e.length;for(let i=0;i<n;i++){const{id:n}=e[i];if(t[n])return;t[n]=!0;const o=this._listeners[n]&&this._listeners[n].length;if(o)for(let e=0;e<o;e++)this._listeners[n][e]&&this._listeners[n][e]()}}onElementsChanged(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}offElementsChanged(e,t){if(this._listeners[e])if(t){const n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}updateId(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}_L.$inject=["eventBus"];class wL extends Ds{constructor(e){super(e);const t=this._injector=e.injector;this._changeSupport=t.get("changeSupport"),this._components=t.get("components"),this._renderer=t.get("renderer")}getChildContext(){return{changeSupport:this._changeSupport,components:this._components,renderer:this._renderer,injector:this._injector}}render(){const e=this._components.getComponents("viewer");return vr(1,"div","viewer-container",e&&e.map(((e,t)=>yr(2,e,null,t))),0)}}class CL{constructor(e,t,n,i,o){const{container:r}=n;this._container=r,i.on("renderer.mount",(()=>{Rs(yr(2,wL,{injector:o}),r)})),i.on("renderer.unmount",(()=>{Rs(null,r)}))}getContainer(){return this._container}}CL.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var OL={__init__:["changeSupport","components","renderer"],changeSupport:["type",_L],components:["type",class{constructor(){this._listeners={}}getComponent(e,t){const n=this._listeners[e];if(!n)return;let i;for(let e=0;e<n.length&&(i=n[e].callback(t),!i);e++);return i}getComponents(e,t){const n=this._listeners[e];if(!n)return;const i=[];for(let e=0;e<n.length;e++){const o=n[e].callback(t);o&&i.push(o)}return i.length?i:void 0}onGetComponent(e,t,n){if(l(t)&&(n=t,t=1e3),!a(t))throw new Error("priority must be a number");const i=this._getListeners(e);let o,r;const s={priority:t,callback:n};for(r=0;o=i[r];r++)if(o.priority<t)return void i.splice(r,0,s);i.push(s)}offGetComponent(e,t){const n=this._getListeners(e);let i,o,r;if(t)for(r=n.length-1;i=n[r];r--)o=i.callback,o===t&&n.splice(r,1);else n.length=0}_getListeners(e){let t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}],eventBus:["type",j],renderer:["type",CL]};let kL=class{constructor(e={}){let{injector:t}=e;if(!t){let{modules:n,config:i}=this._init(e);t=function(e,t){const n=[{config:["value",e]},OL].concat(t||[]),i=new Sn(n);return i.init(),i}(i,n)}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("viewer.init")}_init(e){let{modules:t,...n}=e;return{modules:t,config:n}}destroy(){this.get("eventBus").fire("viewer.destroy")}clear(){this.get("eventBus").fire("viewer.clear")}};let EL=class{constructor(e,t){this._eventBus=t,this._viewer=e}getDecision(){return this._viewer.getDecision()}updateId(e,t){if(e!==this.getDecision())throw new Error("element !== decision");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}};EL.$inject=["viewer","eventBus"];var SL={__init__:["elementRegistry"],elementRegistry:["type",EL]};class RL extends Ds{constructor(e,t){super(e,t),this._viewer=t.injector.get("viewer")}render(){const{name:e}=this._viewer.getDecision();return vr(1,"div","decision-properties",vr(1,"h3","decision-name",e,0),2)}}let TL=class{constructor(e){e.onGetComponent("viewer",1500,(()=>RL))}};TL.$inject=["components"];var ML={__init__:["decisionProperties"],decisionProperties:["type",TL]};let AL=class extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._viewer=t.injector.get("viewer")}render(){const{decisionLogic:e,variable:t}=this._viewer.getDecision();return vr(1,"div","literal-expression-properties",vr(1,"table",null,[vr(1,"tr",null,[vr(1,"td",null,this._translate("Variable name:"),0),vr(1,"td",null,vr(1,"span",null,t.name||"-",0),2)],4),vr(1,"tr",null,[vr(1,"td",null,this._translate("Variable type:"),0),vr(1,"td",null,vr(1,"span",null,this._translate(t.typeRef||"")||"-",0),2)],4),vr(1,"tr",null,[vr(1,"td",null,this._translate("Expression language:"),0),vr(1,"td",null,vr(1,"span",null,e.expressionLanguage||"-",0),2)],4)],4),2)}};class PL{constructor(e){e.onGetComponent("viewer",500,(()=>AL))}}PL.$inject=["components"];var DL={__depends__:[],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",PL]};let $L=class{constructor(e){e.onGetComponent("viewer",2e3,(()=>Bs))}};$L.$inject=["components"];var jL={__init__:["poweredBy"],poweredBy:["type",$L]};class IL extends Ds{constructor(e,t){super(e,t),this._viewer=t.injector.get("viewer")}render(){const{text:e}=this._viewer.getDecision().decisionLogic;return vr(1,"div","textarea",vr(1,"div","content",e,0),2)}}let BL=class{constructor(e){e.onGetComponent("viewer",(()=>IL))}};BL.$inject=["components"];var LL={__init__:["textarea"],textarea:["type",BL]};let NL=class extends Ds{constructor(e,t){super(e,t);const{injector:n}=t;this._translate=n.get("translate"),this._eventBus=n.get("eventBus")}onClick=()=>{this._eventBus.fire("showDrd")};render(){return vr(1,"div","view-drd",vr(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(e=>this.node=e))}};NL.$inject=["translate"];let qL=class{constructor(e,t,n,i){this._injector=i,this._viewer=t,e.onGetComponent("viewer",2e3,(()=>{if(this.canViewDrd())return NL})),n.on("showDrd",(()=>{const e=i.get("_parent",!1),t=this.getDefinitions(),n=e.getView(t);e.open(n)}))}canViewDrd(){const e=this._injector.get("_parent",!1);if(!e)return;const t=this.getDefinitions();return!!e.getView(t)}getDefinitions(){return this._viewer.getDecision().$parent}};qL.$inject=["components","viewer","eventBus","injector"];var VL={__init__:["viewDrd"],viewDrd:["type",qL]};let FL=class e extends kL{constructor(t={}){const n=e._createContainer();super(M(t,{renderer:{container:n}})),this._container=n}open(e){var t=this;return new Promise((function(n,i){var o;try{t._decision&&(t.clear(),t.get("eventBus").fire("renderer.unmount")),t._decision=e,t.get("eventBus").fire("import",e),t.get("eventBus").fire("renderer.mount")}catch(e){o=e}o?(o.warnings=o.warnings||[],i(o)):n({warnings:[]})}))}_init(e){let{modules:t,additionalModules:n,...i}=e;return{modules:[...t||this.getModules(),...n||[],...[{viewer:["value",this]}]],config:i}}on(e,t,n,i){return this.get("eventBus").on(e,t,n,i)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}getDecision(){return this._decision}attachTo(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}detach(){const e=this._container;e.parentNode&&(this._emit("detach",{}),en(e))}destroy(){super.destroy(),this.detach()}getModules(){return e._getModules()}static _getModules(){return[SL,ha,ML,DL,jL,LL,VL]}static _createContainer(){return Gt('<div class="dmn-literal-expression-container"></div>')}};class zL extends Ds{constructor(e,t){super(e,t),this._viewer=t.injector.get("viewer"),this._modeling=t.injector.get("modeling"),this._translate=t.injector.get("translate"),this.setupChangeListeners({bind:this.getDecision().id})}componentWillUnmount(){this.setupChangeListeners({unbind:this.getDecision().id})}getDecision(){return this._viewer.getDecision()}onElementsChanged=()=>{this.forceUpdate()};setupChangeListeners({bind:e,unbind:t}){const{changeSupport:n}=this.context;"string"==typeof t&&n.offElementsChanged(t,this.onElementsChanged),"string"==typeof e&&n.onElementsChanged(e,this.onElementsChanged)}setDecisionName=e=>{this._modeling.editDecisionName(e)};render(){const{name:e}=this.getDecision();return vr(1,"header","decision-properties",yr(2,QL,{label:this._translate("Decision name"),className:"decision-name editor",value:e,onBlur:HL,onChange:this.setDecisionName}),2)}}class QL extends vx{render(){return vr(1,"h3",this.getClassName(),this.getEditor(),0)}}function HL(e){e.target.scroll(0,0)}class WL{constructor(e){e.onGetComponent("viewer",1500,(()=>zL))}}WL.$inject=["components"];var UL={__depends__:[wx,ha],__init__:["decisionProperties"],decisionProperties:["type",WL]};const XL="is not a registered action";let KL=class{constructor(e,t){this._actions={undo(){e.undo()},redo(){e.redo()}}}trigger(e,t){if(!this._actions[e])throw GL(e,XL);return this._actions[e](t)}register(e,t){if("string"==typeof e)return this._registerAction(e,t);p(e,((e,t)=>{this._registerAction(t,e)}))}_registerAction(e,t){if(this.isRegistered(e))throw GL(e,"is already registered");this._actions[e]=t}unregister(e){if(!this.isRegistered(e))throw GL(e,XL);this._actions[e]=void 0}isRegistered(e){return!!this._actions[e]}};function GL(e,t){return new Error(e+" "+t)}KL.$inject=["commandStack","eventBus"];var YL={__init__:["editorActions"],editorActions:["type",KL]};function ZL(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function JL(e){return e.shiftKey}var eN="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/pull/662";class tN{constructor(e,t,n,i){this._config=e||{},this._eventBus=t,this._editorActions=n,this._listeners=[],t.on("viewer.destroy",this._destroy),t.on("viewer.init",this._init),t.on("attach",(()=>{this._config.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(eN)),this._target=i.getContainer(),this._config&&!1!==this._config.bind&&this.bind()})),t.on("detach",this.unbind)}_init=()=>{this._registerDefaultBindings(),this._fire("init")};_destroy=()=>{this._fire("destroy"),this.unbind(),this._listeners=null};_keyHandler=e=>{var t,n,i=this._listeners,o=e.keyCode||e.charCode||-1;for(t=0;n=i[t];t++)if(n(o,e))return e.preventDefault(),void e.stopPropagation()};bind(e){e&&console.error("unsupported argument <node>",new Error(eN)),this.unbind(),e=this._node=this._target,zt.bind(e,"keydown",this._keyHandler,!0),this._fire("bind")}getBinding(){return this._node}unbind=()=>{var e=this._node;e&&(this._fire("unbind"),zt.unbind(e,"keydown",this._keyHandler,!0)),this._node=null};_fire(e){this._eventBus.fire("keyboard."+e,{node:this._node,listeners:this._listeners})}_registerDefaultBindings(){var e=this._listeners,t=this._editorActions;e.push((function(e,n){if(ZL(n)&&!JL(n)&&90===e)return t.trigger("undo"),!0})),e.push((function(e,n){if(ZL(n)&&(89===e||90===e&&JL(n)))return t.trigger("redo"),!0}))}addListener(e){this._listeners.unshift(e)}removeListener(e){this._listeners=this._listeners.filter((t=>t!==e))}}tN.$inject=["config.keyboard","eventBus","editorActions","renderer"];var nN={__depends__:[YL],__init__:["keyboard"],keyboard:["type",tN]};class iN extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._viewer=t.injector.get("viewer"),this._modeling=t.injector.get("modeling"),this._dataTypes=t.injector.get("dataTypes"),this._eventBus=t.injector.get("eventBus");const n=this._viewer.getDecision();this.state={name:n.variable.name,typeRef:n.variable.typeRef},this.setVariableName=this.setVariableName.bind(this),this.setVariableType=this.setVariableType.bind(this)}setVariableName(e){this._modeling.editVariableName(e),this.setState({name:e})}componentWillMount(){this._eventBus.on("elements.changed",this.onChange)}componentWillUnmount(){this._eventBus.off("elements.changed",this.onChange)}onChange=()=>{const e=this._viewer.getDecision();e.variable&&this.setState({name:e.variable.name})};setVariableType(e){""===e?(this._modeling.editVariableType(void 0),this.setState({typeRef:void 0})):(this._modeling.editVariableType(e),this.setState({typeRef:e}))}render(){const{name:e,typeRef:t}=this.state,n=this._dataTypes.getAll().map((e=>({label:this._translate(e),value:e})));return vr(1,"div","literal-expression-properties",vr(1,"table","variables-table",[vr(1,"tr",null,[vr(1,"td",null,this._translate("Variable name:"),0),vr(1,"td",null,yr(2,hb,{label:this._translate("Variable name"),className:"variable-name-input",onInput:this.setVariableName,placeholder:this._translate("name"),value:e||""}),2)],4),vr(1,"tr",null,[vr(1,"td",null,this._translate("Variable type:"),0),vr(1,"td",null,vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Variable type"),onChange:this.setVariableType,options:n,value:t,className:"variable-type-select dms-block"}),2),2)],4),yr(2,oN)],4),2)}}class oN extends Ds{constructor(e,t){super(e,t),this._translate=t.injector.get("translate"),this._viewer=t.injector.get("viewer"),this._modeling=t.injector.get("modeling"),this._expressionLanguages=t.injector.get("expressionLanguages"),this.setExpressionLanguage=this.setExpressionLanguage.bind(this)}setExpressionLanguage(e){""===e?this._modeling.editExpressionLanguage(void 0):this._modeling.editExpressionLanguage(e)}_getExpressionLanguage(){const e=this._viewer.getDecision().decisionLogic;return e&&e.expressionLanguage?e.expressionLanguage.toLowerCase():this._getDefaultExpressionLanguage()}_getDefaultExpressionLanguage(){return this._expressionLanguages.getDefault().value}_shouldRender(){if(this._expressionLanguages.getAll().length>1)return!0;return this._getExpressionLanguage()!==this._getDefaultExpressionLanguage()}render(){if(!this._shouldRender())return null;const e=this._getExpressionLanguage(),t=this._expressionLanguages.getAll();return vr(1,"tr",null,[vr(1,"td",null,this._translate("Expression language:"),0),vr(1,"td",null,vr(1,"div","dms-fill-row",yr(2,Z$,{label:this._translate("Expression language"),onChange:this.setExpressionLanguage,options:t,value:e,className:"expression-language-select dms-block"}),2),2)],4)}}class rN{constructor(e){e.onGetComponent("viewer",500,(()=>iN))}}rN.$inject=["components"];var sN={__depends__:[wx,nN,jv,ib],__init__:["literalExpressionProperties"],literalExpressionProperties:["type",rN]};let aN=class e{constructor(e,t,n){this._commandStack=e,this._viewer=t,this._eventBus=n,n.on("viewer.init",(()=>{!function(e,t){p(e,(function(e,n){t.registerHandler(n,e)}))}(this.getHandlers(),e)}))}getHandlers(){return e._getHandlers()}static _getHandlers(){return{"element.updateProperties":dI}}getDecision(){return this._viewer.getDecision()}editDecisionName(e){const t={element:this.getDecision(),properties:{name:e}};this._commandStack.execute("element.updateProperties",t)}editDecisionId(e){const t={element:this.getDecision(),properties:{id:e}};this._commandStack.execute("element.updateProperties",t)}editLiteralExpressionText(e){const t={element:this.getDecision().decisionLogic,properties:{text:e}};this._commandStack.execute("element.updateProperties",t)}editExpressionLanguage(e){const t={element:this.getDecision().decisionLogic,properties:{expressionLanguage:e}};this._commandStack.execute("element.updateProperties",t)}editVariableName(e){const t={element:this.getDecision().variable,properties:{name:e}};this._commandStack.execute("element.updateProperties",t)}editVariableType(e){const t={element:this.getDecision().variable,properties:{typeRef:e}};this._commandStack.execute("element.updateProperties",t)}updateProperties(e,t){const n={element:e,properties:t};this._commandStack.execute("element.updateProperties",n)}};aN.$inject=["commandStack","viewer","eventBus"];var lN={__init__:["idChangeBehavior","nameChangeBehavior","modeling"],commandStack:["type",bp],idChangeBehavior:["type",qp],nameChangeBehavior:["type",Vp],modeling:["type",aN]};let cN=class extends Ds{constructor(e,t){super(e,t),this._modeling=t.injector.get("modeling"),this._viewer=t.injector.get("viewer"),this._expressionLanguages=t.injector.get("expressionLanguages"),this._variableResolver=t.injector.get("variableResolver",!1),this._translate=t.injector.get("translate"),this.editLiteralExpressionText=this.editLiteralExpressionText.bind(this),this.onElementsChanged=this.onElementsChanged.bind(this);const{id:n}=this.getLiteralExpression();t.changeSupport.onElementsChanged(n,this.onElementsChanged)}getLiteralExpression(){return this._viewer.getDecision().decisionLogic}onElementsChanged(){this.forceUpdate()}editLiteralExpressionText(e){this._modeling.editLiteralExpressionText(e)}getEditor(){return this.isFeel()?uN:hN}isFeel(){return"feel"===this.getExpressionLanguage()}getExpressionLanguage(){return this.getLiteralExpression().expressionLanguage||this._expressionLanguages.getDefault().value}_getVariables(){const e=this.getLiteralExpression();return this._variableResolver&&this._variableResolver.getVariables(e)}render(){const{text:e}=this.getLiteralExpression(),t=this.getEditor(),n=this._getVariables();return yr(2,t,{label:this._translate("Literal expression editor"),className:"textarea editor",value:e,onChange:this.editLiteralExpressionText,variables:n})}},uN=class extends Ds{render(){return yr(2,U$,{label:this.props.label,className:this.props.className,value:this.props.value,onInput:this.props.onChange,variables:this.props.variables})}},hN=class extends vx{render(){return vr(1,"div",this.getClassName(),this.getEditor(),0)}};class dN{constructor(e){e.onGetComponent("viewer",(()=>cN))}}dN.$inject=["components"];var pN={__depends__:[wx,ha],__init__:["textarea"],textarea:["type",dN]};let fN=class e extends FL{getModules(){return[...FL._getModules(),...e._getModules()]}static _getModules(){return[UL,nN,sN,lN,jv,ob,pN,Bm]}};function gN(e,{injector:t}){const n=t.get("components").getComponents("header");return vr(1,"div","dmn-boxed-expression-section dmn-boxed-expression-header",n&&n.map(((e,t)=>yr(2,e,null,t))),0)}function mN(e,{injector:t}){const n=t.get("components").getComponents("body");return vr(1,"div","dmn-boxed-expression-section dmn-boxed-expression-body",n&&n.map(((e,t)=>yr(2,e,null,t))),0)}function vN(e,{injector:t}){const n=t.get("components").getComponents("footer");return vr(1,"div","dmn-boxed-expression-section dmn-boxed-expression-footer",n&&n.map(((e,t)=>yr(2,e,null,t))),0)}var yN={__init__:["viewRenderer","tableJsSupport"],viewRenderer:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("viewer",(()=>gN)),e.onGetComponent("viewer",(()=>mN)),e.onGetComponent("viewer",(()=>vN))}}],tableJsSupport:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("viewer",(()=>{const t=e.getComponents("table.before")||[];return()=>vr(1,"div",null,t.map(((e,t)=>yr(2,e,null,t))),0)}))}}]};class xN{constructor(e){e.onGetComponent("viewer",2e3,(()=>Bs))}}xN.$inject=["components"];var bN={__init__:["poweredBy"],poweredBy:["type",xN]};function _N({expression:e},t){return vr(1,"div","textarea",vr(1,"div","content",t.injector.get("literalExpression").getText(e),0),2)}class wN{getText(e){return e.get("text")}}var CN={__init__:["literalExpressionComponent"],literalExpressionComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("expression",(({expression:e})=>{if(hn(e,"dmn:LiteralExpression"))return _N}))}}],literalExpression:["type",wN]};class ON{getParameters(e){return e.get("formalParameter")}getBody(e){return e.get("body")}getKind(e){return e.get("kind")||"FEEL"}}function kN({expression:e},t){const n=t.injector.get("functionDefinition"),i=n.getKind(e),o=n.getParameters(e),r=n.getBody(e);return vr(1,"div","function-definition",[yr(2,SN,{kind:i}),yr(2,RN,{parameters:o}),yr(2,MN,{expression:r})],4)}const EN={FEEL:"F",Java:"J",PMML:"P"};function SN({kind:e},t){const n=t.injector.get("translate");return vr(1,"div","function-definition-kind",EN[e],0,{title:n("Function kind: {kind}",{kind:e})})}function RN({parameters:e}){return vr(1,"div","function-definition-parameters",vr(1,"div",null,[xr("("),e.reduce(((e,t)=>e.concat(yr(2,TN,{parameter:t}),", ")),[]).slice(0,-1),xr(")")],0),2)}function TN({parameter:e}){const{name:t,typeRef:n}=e,i=t||"<unnamed>";return vr(1,"span",null,n?`${i}: ${n}`:i,0)}function MN({expression:e},t){return vr(1,"div","function-definition-body",yr(2,t.components.getComponent("expression",{expression:e}),{expression:e}),2)}var AN={__init__:["functionDefinitionComponent"],functionDefinition:["type",ON],functionDefinitionComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("expression",(({expression:e})=>{if(hn(e,"dmn:FunctionDefinition"))return kN}))}}]};class PN extends Ds{constructor(e,t){super(e,t);const{injector:n}=t;this._translate=n.get("translate"),this._eventBus=n.get("eventBus")}onClick=()=>{this._eventBus.fire("showDrd")};render(){return vr(1,"div","view-drd",vr(1,"button","view-drd-button",this._translate("View DRD"),0,{type:"button",onClick:this.onClick}),2,null,null,(e=>this.node=e))}}PN.$inject=["translate"];class DN{constructor(e,t,n){this._injector=n,e.onGetComponent("viewer",2e3,(()=>{if(this.canViewDrd())return PN})),t.on("showDrd",(()=>{const e=n.get("_parent",!1),t=e.getDefinitions(),i=e.getView(t);e.open(i)}))}canViewDrd(){const e=this._injector.get("_parent",!1);if(!e)return;const t=e.getDefinitions();return!!e.getView(t)}}DN.$inject=["components","eventBus","injector"];var $N={__init__:["viewDrd"],viewDrd:["type",DN]};function jN(e,t){const n=t.injector.get("viewer"),{name:i}=n.getRootElement();return vr(1,"div","element-properties",vr(1,"h2","element-name",i,0),2)}class IN{constructor(e){e.onGetComponent("header",(()=>jN))}}IN.$inject=["components"];var BN={__init__:["elementProperties"],elementProperties:["type",IN]};function LN(e,{injector:t}){const n=t.get("components"),i=function(e){if(hn(e,"dmn:Decision"))return e.get("decisionLogic");if(hn(e,"dmn:BusinessKnowledgeModel"))return e.get("encapsulatedLogic")}(t.get("viewer").getRootElement());return yr(2,n.getComponent("expression",{expression:i}),{expression:i})}function NN({expression:e}){return vr(1,"div",null,vr(1,"span",null,[xr("Expression of type "),e.$type,xr(" is not supported.")],0,{style:"color:red;"}),2)}var qN={__init__:["elementLogic"],elementLogic:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("body",(()=>LN)),e.onGetComponent("expression",100,(()=>NN))}}]};class VN{static $inject=["viewer"];constructor(e){this._viewer=e}getName(){const e=this.getVariable(),t=this._getElement();return(e?e.get("name"):null)||t.get("name")}getType(){const e=this.getVariable();return e?e.get("typeRef"):"Any"}_getElement(){return this._viewer.getRootElement()}getVariable(){return this._getElement().get("variable")}}function FN(e,t){const n=t.injector.get("elementVariable"),i=t.injector.get("translate"),o=n.getName(),r=n.getType();return vr(1,"div","element-variable",[vr(1,"h2",null,xr("Result"),2),vr(1,"div","element-variable-name",[vr(1,"span","element-variable-name-label",i("Variable name"),0),vr(1,"span",null,o,0)],4),vr(1,"div","element-variable-type",[vr(1,"span","element-variable-type-label",i("Variable type"),0),vr(1,"span",null,r,0)],4)],4)}var zN={__init__:["elementVariableComponent"],elementVariable:["type",VN],elementVariableComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("footer",(()=>FN))}}]};class QN extends kL{constructor(e={}){const t=QN._createContainer();super(M(e,{renderer:{container:t}})),this._container=t}open(e){const t=this.get("eventBus");return new Promise(((n,i)=>{let o;try{this.getRootElement()&&(this.clear(),t.fire("renderer.unmount")),this._setRootElement(e),t.fire("import",e),t.fire("renderer.mount")}catch(e){o=e}o?(o.warnings=o.warnings||[],i(o)):n({warnings:[]})}))}_init(e){let{modules:t,additionalModules:n,...i}=e;return{modules:[...t||this.getModules(),...n||[],...[{viewer:["value",this]}]],config:i}}on(e,t,n,i){return this.get("eventBus").on(e,t,n,i)}off(e,t){this.get("eventBus").off(e,t)}_emit(e,t){return this.get("eventBus").fire(e,t)}getRootElement(){return this._root}_setRootElement(e){this._root=e}attachTo(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}detach(){const e=this._container;e.parentNode&&(this._emit("detach",{}),en(e))}destroy(){super.destroy(),this.detach()}getModules(){return[yN,ha,bN,$N,BN,qN,AN,CN,zN]}static _createContainer(){return Gt('<div class="dmn-boxed-expression-container"></div>')}}var HN={__depends__:[sp],__init__:["keyboardBindings"],keyboardBindings:["type",class{static $inject=["editorActions","keyboard"];constructor(e,t){this.registerBindings(t,e)}registerBindings(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(ml(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(vl(e.keyEvent))return t.trigger("redo"),!0}))}}]};function WN(e){return e.$parent}class UN{constructor(e,t,n){this._commandStack=e,this._viewer=t,this._eventBus=n,function(e,t){p(e,(function(e,n){t.registerHandler(n,e)}))}(this._getHandlers(),e)}_getHandlers(){return{"element.updateProperties":dI}}updateProperties(e,t){const n={element:e,properties:t};this._commandStack.execute("element.updateProperties",n)}}UN.$inject=["commandStack","viewer","eventBus"];var XN={__init__:["idChangeBehavior","modeling","nameChangeBehavior"],commandStack:["type",bp],idChangeBehavior:["type",qp],modeling:["type",UN],nameChangeBehavior:["type",class extends Gd{static $inject=["eventBus","modeling"];constructor(e,t){super(e),this._modeling=t,this.postExecuted("element.updateProperties",this.updateName)}updateName=({context:e})=>{const{element:t,properties:n}=e;this.isNameChanged(n)&&(this.isVariable(t)?this.handleVariableNameChange(t):this.isVariableContainer(t)&&this.handleVariableContainerNameChange(t))};isNameChanged(e){return"name"in e}isVariable(e){const t=WN(e);return hn(e,"dmn:InformationItem")&&t&&t.get("variable")===e}isVariableContainer(e){const t=e.get("variable");return t&&hn(t,"dmn:InformationItem")}handleVariableNameChange(e){const t=WN(e),n=e.get("name");n!==t.get("name")&&this._modeling.updateProperties(t,{name:n})}handleVariableContainerNameChange(e){const t=e.get("variable"),n=e.get("name");t&&n!==t.get("name")&&this._modeling.updateProperties(t,{name:n})}}]};function KN(e,t){return function(n){return br(yr(2,GN,{...n,_component:e,_selectDependencies:t}))}}class GN extends Ds{constructor(e,t){super(e,t),this._eventBus=t.injector.get("eventBus")}componentDidMount(){this._subscribe()}componentWillUnmount(){this._unsubscribe()}_subscribe(){this._eventBus.on("elements.changed",this.onChange)}_unsubscribe(){this._eventBus.off("elements.changed",this.onChange)}onChange=({elements:e})=>{this.props._selectDependencies(this.props).some((t=>e.includes(t)))&&this.forceUpdate()};render(){return br(yr(2,this.props._component,{...this.props}))}}function YN(e){return br(yr(2,U$,{...e,onChange:e.onChange}))}class ZN extends vx{render(){return vr(1,"div",this.getClassName(),this.getEditor(),0)}}const JN=KN(class extends Ds{constructor(e,t){super(e,t),this._literalExpression=t.injector.get("literalExpression"),this._translate=t.injector.get("translate"),this._expressionLanguages=t.injector.get("expressionLanguages"),this._variableResolver=t.injector.get("variableResolver",!1)}getLiteralExpression(){return this.props.expression}editLiteralExpressionText=e=>{const t=this.getLiteralExpression();this._literalExpression.setText(t,e)};getEditor(){return this.isFeel()?YN:ZN}isFeel(){return function(e){for(let t=e;t;t=t.$parent){const e=t.get("expressionLanguage");if(e)return!("https://www.omg.org/spec/DMN/20191111/FEEL/"!==e&&!/feel/i.test(e));if(hn(t,"dmn:FunctionDefinition"))return"FEEL"===(t.get("kind")||"FEEL")}return!0}(this.getLiteralExpression())}_getVariables(){const e=this.getLiteralExpression();return this._variableResolver&&this._variableResolver.getVariables(e)}render(){const{text:e}=this.getLiteralExpression(),t=this.getEditor(),n=this._getVariables();return yr(2,t,{label:this._translate("Literal expression"),className:"textarea editor",value:e,onChange:this.editLiteralExpressionText,variables:n})}},(e=>[e.expression]));class eq extends wN{constructor(e){super(),this._modeling=e}setText(e,t){this._modeling.updateProperties(e,{text:t})}}eq.$inject=["modeling"];var tq={__init__:["literalExpressionComponent"],literalExpressionComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("expression",(({expression:e})=>{if(hn(e,"dmn:LiteralExpression"))return JN}))}}],literalExpression:["type",eq]};function nq({label:e,onClick:t}){return vr(1,"button","edit-button dmn-icon-edit",null,1,{"aria-label":e,type:"button",onClick:t})}const iq=KN((function({expression:e},t){const n=t.injector.get("functionDefinition"),i=t.injector.get("contextMenu"),o=n.getKind(e),r=n.getParameters(e),s=n.getBody(e);return vr(1,"div","function-definition",[yr(2,rq,{kind:o,openEditor:t=>{const n=cq(t);i.open(n,{contextMenuType:"kind-editor",expression:e})}}),yr(2,sq,{parameters:r,openEditor:t=>{const n=cq(t);i.open(n,{contextMenuType:"formal-parameters-editor",expression:e})}}),yr(2,lq,{expression:s,parameters:r})],4)}),(e=>[e.expression]));const oq={FEEL:"F",Java:"J",PMML:"P"};function rq({kind:e,openEditor:t},n){const i=n.injector.get("translate");return vr(1,"div","function-definition-kind",[oq[e],yr(2,nq,{label:i("Edit function kind"),onClick:t})],0)}function sq({openEditor:e,parameters:t},n){const i=n.injector.get("translate");return vr(1,"div","function-definition-parameters",[vr(1,"div",null,[xr("("),t.reduce(((e,t)=>e.concat(yr(2,aq,{parameter:t}),", ")),[]).slice(0,-1),xr(")")],0),yr(2,nq,{label:i("Edit formal parameters"),onClick:e})],4)}const aq=KN((function({parameter:e}){const{name:t,typeRef:n}=e,i=t||"<unnamed>";return vr(1,"span",null,n?`${i}: ${n}`:i,0)}),(e=>[e.parameter]));const lq=KN((function({expression:e,parameters:t},n){return vr(1,"div","function-definition-body",yr(2,n.components.getComponent("expression",{expression:e}),{expression:e,parameters:t}),2)}),(e=>e.parameters));function cq(e){const t=e.target.parentElement.getBoundingClientRect();return{x:t.x,y:t.y}}const uq=[{value:"FEEL",label:"FEEL"},{value:"Java",label:"Java"},{value:"PMML",label:"PMML"}];function hq({context:{expression:e}},t){const n=t.injector.get("functionDefinition"),i=t.injector.get("translate"),o=n.getKind(e);return vr(1,"div","context-menu-container",[vr(1,"h3",null,i("Edit function kind"),0),yr(2,Z$,{label:i("Kind"),options:uq,value:o,onChange:t=>{n.setKind(e,t)},noInput:!0})],4)}const dq=KN((function({context:{expression:e}},t){const n=t.injector.get("functionDefinition"),i=t.injector.get("translate"),o=n.getParameters(e);return vr(1,"div","context-menu-container formal-parameters",[vr(1,"h3",null,i("Edit formal parameters"),0),o.length?vr(1,"table",null,[vr(1,"thead",null,vr(1,"tr",null,[vr(1,"th",null,xr("Name"),2),vr(1,"th",null,xr("Type"),2)],4),2),vr(1,"tbody",null,o.map(((t,i)=>yr(2,pq,{parameter:t,remove:()=>(t=>{n.removeParameter(e,t)})(t)},i))),0)],4):null,vr(1,"button","add-parameter",i("Add parameter"),0,{type:"button",onClick:()=>{n.addParameter(e)}})],0)}),(e=>[e.context.expression]));const pq=KN((function({parameter:e,remove:t},n){const i=n.injector.get("dataTypes"),o=n.injector.get("translate"),r=n.injector.get("functionDefinition"),{name:s,typeRef:a}=e,l=i.getAll().map((e=>({label:o(e),value:e})));return vr(1,"tr","function-definition-parameter",[vr(1,"td",null,yr(2,hb,{onChange:t=>{r.updateParameter(e,{name:t})},value:s}),2),vr(1,"td",null,yr(2,Z$,{onChange:t=>{r.updateParameter(e,{typeRef:t})},value:a,options:l}),2),vr(1,"td",null,vr(1,"button","dmn-icon-trash",null,1,{type:"button",onClick:t,"aria-label":o("Remove parameter")}),2)],4)}),(e=>[e.parameter]));var fq={__init__:["formalParametersEditorComponent","functionDefinitionComponent","kindEditorComponent"],__depends__:[Ux],formalParametersEditorComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"formal-parameters-editor"===e.contextMenuType)return dq}))}}],functionDefinition:["type",class extends ON{static $inject=["modeling","dmnFactory"];constructor(e,t){super(),this._modeling=e,this._dmnFactory=t}addParameter(e){this._modeling.updateProperties(e,{formalParameter:[...this.getParameters(e),this._dmnFactory.create("dmn:InformationItem",{name:"",typeRef:""})]})}removeParameter(e,t){this._modeling.updateProperties(e,{formalParameter:this.getParameters(e).filter((e=>e!==t))})}updateParameter(e,t){this._modeling.updateProperties(e,t)}setKind(e,t){this._modeling.updateProperties(e,{kind:t})}}],functionDefinitionComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("expression",(({expression:e})=>{if(hn(e,"dmn:FunctionDefinition"))return iq}))}}],kindEditorComponent:["type",class{static $inject=["components"];constructor(e){e.onGetComponent("context-menu",((e={})=>{if(e.contextMenuType&&"kind-editor"===e.contextMenuType)return hq}))}}]};const gq=KN((function(e,t){const{element:n}=e,i=t.injector.get("modeling"),o=t.injector.get("translate"),r=n.get("name");return yr(2,hb,{label:o("Element name"),className:"element-name editor",value:r,onChange:e=>{i.updateProperties(n,{name:e})}})}),(e=>[e.element]));function mq(e,t){const n=t.injector.get("viewer").getRootElement();return vr(1,"div","element-properties",yr(2,gq,{element:n}),2)}class vq{constructor(e){e.onGetComponent("header",(()=>mq))}}vq.$inject=["components"];var yq={__depends__:[wx],__init__:["elementProperties"],elementProperties:["type",vq]};class xq{constructor(e,t){this._eventBus=t,this._viewer=e}updateId(e,t){if(e!==this._viewer.getRootElement())throw new Error("element !== rootElement");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}}xq.$inject=["viewer","eventBus"];var bq={__init__:["elementRegistry"],elementRegistry:["type",xq],dmnFactory:["type",class{static $inject=["moddle"];constructor(e){this._moddle=e}create(e,t={}){return this._moddle.create(e,t)}}]};const _q="dmn-boxed-expression-variable-type";function wq(e,t){const n=t.injector.get("elementVariable"),i=t.injector.get("translate"),o=n.getName();return vr(1,"div","element-variable",[vr(1,"h2",null,xr("Result"),2),vr(1,"div","element-variable-name",[vr(1,"span","element-variable-name-label",i("Variable name"),0),vr(1,"span",null,o,0)],4),vr(1,"div","element-variable-type",[vr(1,"label","element-variable-type-label",xr("Result type"),2,{for:_q}),yr(2,Cq)],4)],4)}function Cq(e,t){const n=t.injector.get("elementVariable"),i=t.injector.get("dataTypes"),o=t.injector.get("translate"),r=n.getType(),s=i.getAll().map((e=>({label:o(e),value:e})));return yr(2,Z$,{value:r,onChange:e=>n.setType(e),options:s,id:_q})}var Oq={__init__:["elementVariableComponent"],elementVariable:["type",class extends VN{static $inject=["viewer","modeling","dmnFactory"];constructor(e,t,n){super(e),this._modeling=t,this._dmnFactory=n}setType(e){const t=this.getVariable();if(t)this._modeling.updateProperties(t,{typeRef:e});else{const t=this._getElement();this._modeling.updateProperties(t,{variable:this._dmnFactory.create("dmn:InformationItem",{name:t.get("name"),typeRef:e})})}}}],elementVariableComponent:["type",class{static $inject=["components","elementVariable"];constructor(e,t){const n=KN(wq,(()=>[t.getVariable()]));e.onGetComponent("footer",(()=>n))}}]};const kq="is not a registered action";class Eq{constructor(e,t){this._actions={undo(){e.undo()},redo(){e.redo()}}}trigger(e,t){if(!this._actions[e])throw Sq(e,kq);return this._actions[e](t)}register(e,t){if("string"==typeof e)return this._registerAction(e,t);p(e,((e,t)=>{this._registerAction(t,e)}))}_registerAction(e,t){if(this.isRegistered(e))throw Sq(e,"is already registered");this._actions[e]=t}unregister(e){if(!this.isRegistered(e))throw Sq(e,kq);this._actions[e]=void 0}isRegistered(e){return!!this._actions[e]}}function Sq(e,t){return new Error(e+" "+t)}Eq.$inject=["commandStack","eventBus"];var Rq={__init__:["editorActions"],editorActions:["type",Eq]};class Tq extends QN{getModules(){return[...super.getModules(),bq,XN,Rq,yq,fq,jv,tq,HN,ob,Oq,Bm]}}return class extends vn{_getViewProviders(){return[{id:"drd",constructor:Sm,opens:"dmn:Definitions"},{id:"decisionTable",constructor:bL,opens:e=>hn(e,"dmn:Decision")&&hn(e.decisionLogic,"dmn:DecisionTable")},{id:"literalExpression",constructor:fN,opens:e=>hn(e,"dmn:Decision")&&hn(e.decisionLogic,"dmn:LiteralExpression")},{id:"boxedExpression",constructor:Tq,opens:e=>hn(e,"dmn:BusinessKnowledgeModel")&&mn(e)}]}_getInitialView(e,...t){let n=super._getInitialView(e,...t);if(!n)return;const i=n.element;return hn(i,"dmn:Definitions")&&!Fd(i)&&(n=h(e,(e=>!hn(e.element,"dmn:Definitions")))||n),n}}}));
21 var t,n;this._container=this._createContainer(),t=this._container,n=xn('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position global() class
/plugin/ol3/
H A Dscript.js8pv(t,e){var r=uv(t);if(!r)return t;if(0!==r.indexOf("styles/"))throw new Error("unexpected style u… function
/plugin/bpmnio/vendor/bpmn-js/dist/
H A Dbpmn-modeler.production.min.js197 `,this._current.container)},Tc.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:r,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},Tc.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:r}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()},Tc.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,emptyPlaceholder:this._getEmptyPlaceholder(n),empty:!(Object.keys(i).length||Object.keys(r).length)}},Tc.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},Tc.prototype.reset=function(){const e=this._current.container;Ws(null,e),ve(e)},Tc.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},Tc.prototype._onOpened=function(){this._emit("opened")},Tc.prototype._onClosed=function(){this._emit("closed")},Tc.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=he(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return t.appendChild(n),n},Tc.prototype._bindAutoClose=function(){this._eventBus.once(Mc,this.close,this)},Tc.prototype._unbindAutoClose=function(){this._eventBus.off(Mc,this.close,this)},Tc.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return!0!==i&&(!1===i?(e=1,t=1):(e=i.min,t=i.max),s(e)&&n<e&&(r=e),s(t)&&n>t&&(r=t)),r},Tc.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y<i.height?(o=t.x,a=10):r.y&&(o=t.x,a=t.y-i.height),t.y<n.top&&(a=t.y+i.height),{x:o,y:a}},Tc.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length||this._getContext(e,t).empty},Tc.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},Tc.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Tc.prototype._getEntries=function(e,t){var n={};return g(t,(function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);h(i)?n=i(n):g(i,(function(e,t){n[t]=e}))}else g(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=I(e,["id"])}))})),n},Tc.prototype._getHeaderEntries=function(e,t){var n={};return g(t,(function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);h(i)?n=i(n):g(i,(function(e,t){n[t]=e}))}else{if(!t.getHeaderEntries)return;g(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=I(e,["id"])}))}})),n},Tc.prototype._getEmptyPlaceholder=function(e){const t=e.find((e=>h(e.getEmptyPlaceholder)));return t&&t.getEmptyPlaceholder()},Tc.prototype.isOpen=function(){return!!this._current},Tc.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let n=K(J(e.delegateTarget||e.target,".entry",!0),"data-id");t={id:n,...this._getEntry(n)}}const i=t.action;if(!1!==this._emit("trigger",{entry:t,event:e}))if(h(i)){if("click"===n)return i(e,t)}else if(i[n])return i[n](e,t)},Tc.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};var Oc={search:["value",function(e,t,n){const{keys:i}=n;if(!(t=t.trim().toLowerCase()))throw new Error("<pattern> must not be empty");const r=t.trim().toLowerCase().split(/\s+/);return e.flatMap((e=>{const t=function(e,t,n){const{matchedWords:i,tokens:r}=n.reduce(((n,i)=>{const r=e[i],{tokens:o,matchedWords:a}=function(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],i={},r=t.map(jc),o=[`(?<all>${r.join("\\s+")})`,...r].join("|"),a=new RegExp(o,"ig");let s,c=0;for(;s=a.exec(e);){const[r]=s,o=s.index,a=s.index+r.length,p=0===o,l=a===e.length,u=!!s.groups.all,h=p||/\s/.test(e.charAt(o-1)),d=l||/\s/.test(e.charAt(a+1));s.index>c&&n.push({value:e.slice(c,s.index),index:c}),n.push({value:r,index:s.index,match:!0,wordStart:h,wordEnd:d,start:p,end:l,all:u});const f=u?t:[r];for(const e of f)i[e.toLowerCase()]=!0;c=s.index+r.length}c<e.length&&n.push({value:e.slice(c),index:c});return{tokens:n,matchedWords:i}}(r,t);return{tokens:{...n.tokens,[i]:o},matchedWords:{...n.matchedWords,...a}}}),{matchedWords:{},tokens:{}});if(Object.keys(i).length!==t.length)return null;return r}(e,r,i);return t?{item:e,tokens:t}:[]})).sort(function(e){return(t,n)=>{for(const i of e){const e=Dc(t.tokens[i],n.tokens[i]);if(0!==e)return e;const r=Nc(t.item[i],n.item[i]);if(0!==r)return r}return 0}}(i))}]},Lc={__depends__:[Oc],__init__:["popupMenu"],popupMenu:["type",Tc]},$c={align:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">\n <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',bottom:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',center:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',top:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',middle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>'};function Ic(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}Ic.$inject=["contextPad","popupMenu","translate","canvas"],Ic.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&L(t,this._getEntries(e)),t},Ic.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},Ic.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${$c.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);L(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},Ic.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var Fc=["left","center","right","top","middle","bottom"];function zc(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function Hc(e){Do.call(this,e),this.init()}function Vc(e){Hc.call(this,e)}zc.$inject=["popupMenu","alignElements","translate","rules"],zc.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&L(t,this._getEntries(e)),t},zc.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},zc.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return g(Fc,(function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:$c[o],action:function(){t.trigger(e,o),i.close()}}})),r},Hc.$inject=["eventBus"],e(Hc,Do),Hc.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},Hc.prototype.init=function(){},Vc.$inject=["eventBus"],e(Vc,Hc),Vc.prototype.init=function(){this.addRule("elements.align",(function(e){var t=y(e.elements,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));return!((t=st(t)).length<2)&&t}))};var Gc={__depends__:[is,vs,Lc],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",Ic],alignElementsMenuProvider:["type",zc],bpmnAlignElements:["type",Vc]};function Wc(e,t,n,i){for(var r;r=qc(e,n,t);)n=i(t,n,r);return n}function Uc(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach((function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,p=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-p+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+p+c)}})),r}}function qc(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(e){var t=Kc(e);e.host&&(t=t.concat(Kc(e.host)));e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(Kc(t))}),[])));return t}(e);return m(r,(function(e){return e!==n&&"intersect"===mn(e,i,10)}))}function Kc(e){return(t=e,t.outgoing.map((function(e){return e.target}))).concat(function(e){return e.incoming.map((function(e){return e.source}))}(e));var t}function Yc(){return!0}function Xc(e,t,n){e.on("autoPlace",100,(function(e){var t=e.shape;return function(e,t,n){n||(n={});var i=n.defaultDistance||50,r=fn(e),o=un(e);return{x:o.right+i+t.width/2,y:r.y}}(e.source,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function Zc(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}Xc.$inject=["eventBus","modeling","canvas"],Zc.$inject=["eventBus","selection"];var Qc={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Xc],autoPlaceSelectionBehavior:["type",Zc]};function Jc(e,t){for(d(t)&&(t=[t]);e=e.parent;)if(yr(e,t))return e;return null}function ep(e,t){var n=Jc(e,"bpmn:Process");if(n)return!0;var i,r=["bpmn:Participant","bpmn:Lane"];if(n=Jc(e,r))return Lr(n);if(yr(e,r))return Lr(e);for(i=gr(e);i&&!vr(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find((function(e){var t=gr(e);return t&&t.get("processRef")===i}));return!o||Lr(o)}function tp(e,t,n){var i=ep(e,n);return vr(t,"bpmn:TextAnnotation")?function(e,t,n){var i=un(e),r=n?{x:i.right+t.width/2,y:i.top-50-t.height/2}:{x:i.right+50+t.width/2,y:i.bottom+t.height/2};sn(e)&&(r=fn(e),n?(r.x+=100,r.y-=50):(r.x+=100,r.y+=50));var o={margin:n?-30:30,minDistance:20},a=n?{y:o}:{x:o};return Wc(e,t,r,Uc(a))}(e,t,i):yr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(e,t,n){var i=un(e),r=n?{x:i.right-10+t.width/2,y:i.bottom+40+t.width/2}:{x:i.left-40-t.width/2,y:i.bottom-10+t.height/2},o={margin:30,minDistance:30},a=n?{x:o}:{y:o};return Wc(e,t,r,Uc(a))}(e,t,i):vr(t,"bpmn:FlowNode")?function(e,t,n){var i=un(e),r=fn(e),o=n?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},a=function(e,t){t||(t={});var n=t.defaultDistance||50,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},a=t.maxDistance||250,s=t.reference||"start";function c(e,t){return"n"===i?"start"===s?un(e).top-un(t).bottom:"center"===s?un(e).top-fn(t).y:un(e).top-un(t).top:"w"===i?"start"===s?un(e).left-un(t).right:"center"===s?un(e).left-fn(t).x:un(e).left-un(t).left:"s"===i?"start"===s?un(t).top-un(e).bottom:"center"===s?fn(t).y-un(e).bottom:un(t).bottom-un(e).bottom:"start"===s?un(t).left-un(e).right:"center"===s?fn(t).x-un(e).right:un(t).right-un(e).right}r||(r=Yc);var p=e.incoming.filter(r).map((function(t){var n=o(t),i=n<0?c(t.source,e):c(e,t.source);return{id:t.source.id,distance:i,weight:n}})),l=e.outgoing.filter(r).map((function(t){var n=o(t),i=n>0?c(e,t.target):c(t.target,e);return{id:t.target.id,distance:i,weight:n}})),u=_(p.concat(l).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{}),(function(e,t){var n=t.distance,i=t.weight;return n<0||n>a||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e}),{});return u.distance||n}(e,{filter:function(e){return vr(e,"bpmn:SequenceFlow")},direction:o.directionHint}),s=30,c=o.minDistance,p=o.baseOrientation;vr(e,"bpmn:BoundaryEvent")&&-1!==(p=mn(e,e.host,-25)).indexOf(o.boundaryOrientation)&&(s*=-1);var l=n?{x:i.right+a+t.width/2,y:r.y+np(p,c,o)}:{x:r.x+np(p,c,o),y:i.bottom+a+t.height/2},u={margin:s,minDistance:c},h=n?{y:u}:{x:u};return Wc(e,t,l,Uc(h))}(e,t,i):void 0}function np(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function ip(e,t){e.on("autoPlace",(function(e){var n=e.shape;return tp(e.source,n,t)}))}ip.$inject=["eventBus","elementRegistry"];var rp={__depends__:[Qc],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",ip]};function op(e,t,n,r){Do.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=r;var o=this;this.postExecuted(["shape.create"],(function(e){var t=e.context,n=t.hints||{},i=t.shape,r=t.parent||t.newParent;!1!==n.autoResize&&o._expand([i],r)})),this.postExecuted(["elements.move"],(function(e){var t=e.context,n=i(C(t.closure.topLevel)),r=t.hints,a=!r||r.autoResize;!1!==a&&g(k(n,(function(e){return e.parent.id})),(function(e,t){p(a)&&(e=e.filter((function(e){return m(a,M({id:e.id}))}))),o._expand(e,t)}))})),this.postExecuted(["shape.toggleCollapse"],(function(e){var t=e.context,n=t.hints,i=t.shape;n&&!1===n.autoResize||i.collapsed||o._expand(i.children||[],i)})),this.postExecuted(["shape.resize"],(function(e){var t=e.context,n=t.hints,i=t.shape,r=i.parent;n&&!1===n.autoResize||r&&o._expand([i],r)}))}function ap(e){e.invoke(op,this)}function sp(e){Hc.call(this,e);var t=this;this.addRule("element.autoResize",(function(e){return t.canResize(e.elements,e.target)}))}function cp(e,t){sp.call(this,e),this._modeling=t}op.$inject=["eventBus","elementRegistry","modeling","rules"],e(op,Do),op.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=un(ht(e)),o=un(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),hn(L({},o,a))},op.prototype._expand=function(e,t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(n,t)){var i=function(e,t){var n="";e=un(e),t=un(t),e.top>t.top&&(n=n.concat("n"));e.right<t.right&&(n=n.concat("w"));e.bottom<t.bottom&&(n=n.concat("s"));e.left>t.left&&(n=n.concat("e"));return n}($(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},op.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},op.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},op.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},ap.$inject=["injector"],e(ap,op),ap.prototype.resize=function(e,t,n){vr(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},sp.$inject=["eventBus"],e(sp,Hc),sp.prototype.canResize=function(e,t){return!1},e(cp,sp),cp.$inject=["eventBus","modeling"],cp.prototype.canResize=function(e,t){if(vr(t.di,"bpmndi:BPMNPlane"))return!1;if(!vr(t,"bpmn:Participant")&&!vr(t,"bpmn:Lane")&&!vr(t,"bpmn:SubProcess"))return!1;var n=!0;return g(e,(function(e){(vr(e,"bpmn:Lane")||cn(e))&&(n=!1)})),n};var pp={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",ap],bpmnAutoResizeProvider:["type",cp]};function lp(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",(function(n){t.once("drag.move",1500,(function(t){!function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),a.hover({element:r,gfx:i}),a.move(n))}}(t)}))})),t.on("element.hover",(function(e){i=e.gfx,r=e.element})),t.on("element.hover",1500,(function(e){r&&t.fire("element.out",{element:r,gfx:i})})),t.on("element.out",(function(){i=null,r=null})),this._findTargetGfx=function(e){var t;if(e instanceof MouseEvent)return t=ra(e),function(e){return J(e,"svg, .djs-element",!0)}(document.elementFromPoint(t.x,t.y))}}lp.$inject=["elementRegistry","eventBus","injector"];var up={__init__:["hoverFix"],hoverFix:["type",lp]},hp=Math.round,dp="djs-drag-active";function fp(e){e.preventDefault()}function mp(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||r;var i=e.createEvent(L({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function c(e,i){var o,c=r.payload,p=r.displacement,l=r.globalStart,u=ra(e),h=Ha(u,l),d=r.localStart,f=a(u),v=Ha(f,d);if(!r.active&&(i||(o=h,Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))>r.threshold))){if(L(c,{x:hp(d.x+p.x),y:hp(d.y+p.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return m();r.active=!0,r.keepSelection||(c.previousSelection=n.get(),n.select(null)),r.cursor&&$a(r.cursor),t.addMarker(t.getRootElement(),dp)}ia(e),r.active&&(L(c,{x:hp(f.x+p.x),y:hp(f.y+p.y),dx:hp(v.x),dy:hp(v.y)},{originalEvent:e}),s("move"))}function p(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,ia(e)),t=s("end")),!1===t&&s("rejected"),s("ended",v(!0!==t))}function l(e){Ra("Escape",e)&&(fp(e),m())}function u(t){var n;r.active&&(n=Fa(e),setTimeout(n,400),fp(t)),p(t)}function h(e){c(e)}function d(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function f(e){s("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function m(e){var t;if(r){var n=r.active;n&&s("cancel"),t=v(e),n&&s("canceled",t)}}function v(o){var a,v;s("cleanup"),Ia(),v=r.trapClick?u:p,oe.unbind(document,"mousemove",c),oe.unbind(document,"dragstart",fp),oe.unbind(document,"selectstart",fp),oe.unbind(document,"mousedown",v,!0),oe.unbind(document,"mouseup",v,!0),oe.unbind(document,"keyup",l),oe.unbind(document,"touchstart",h,!0),oe.unbind(document,"touchcancel",m,!0),oe.unbind(document,"touchmove",c,!0),oe.unbind(document,"touchend",p,!0),e.off("element.hover",d),e.off("element.out",f),t.removeMarker(t.getRootElement(),dp);var y=r.payload.previousSelection;return!1!==o&&y&&!n.get().length&&function(e){var t=e.filter((function(e){return i.get(e.id)}));t.length&&n.select(t)}(y),a=r,r=null,a}e.on("diagram.destroy",m),this.init=function(t,n,i,v){r&&m(!1),"string"==typeof n&&(v=i,i=n,n=null);var y,g,b,_,x,w=(v=L({},o,v||{})).data||{};_=v.trapClick?u:p,t?(y=na(t)||t,g=ra(t),ia(t),"dragstart"===y.type&&fp(y)):(y=null,g={x:0,y:0}),b=a(g),n||(n=b),x=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(y),r=L({prefix:i,data:w,payload:{},globalStart:g,displacement:Ha(n,b),localStart:b,isTouch:x},v),v.manual||(x?(oe.bind(document,"touchstart",h,!0),oe.bind(document,"touchcancel",m,!0),oe.bind(document,"touchmove",c,!0),oe.bind(document,"touchend",p,!0)):(oe.bind(document,"mousemove",c),oe.bind(document,"dragstart",fp),oe.bind(document,"selectstart",fp),oe.bind(document,"mousedown",_,!0),oe.bind(document,"mouseup",_,!0)),oe.bind(document,"keyup",l),e.on("element.hover",d),e.on("element.out",f)),s("init"),v.autoActivate&&c(t,!0)},this.move=c,this.hover=d,this.out=f,this.end=p,this.cancel=m,this.context=function(){return r},this.setOptions=function(e){L(o,e)}}mp.$inject=["eventBus","canvas","selection","elementRegistry"];var vp={__depends__:[up,_a],dragging:["type",mp]};function yp(e,t,n){this._canvas=n,this._opts=L({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){var t=i._toBorderPoint(e);i.startScroll(t)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}function gp(e,t,n){return t<e&&e<n}yp.$inject=["config.autoScroll","eventBus","canvas"],yp.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)gp(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(0===c?a=n.scrollStep:1==c?s=n.scrollStep:2==c?a=-n.scrollStep:3==c&&(s=-n.scrollStep));0===a&&0===s||(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout((function(){i.startScroll(e)}),n.scrollRepeatTimeout))},yp.prototype.stopScroll=function(){clearTimeout(this._scrolling)},yp.prototype.setOptions=function(e){this._opts=L({},this._opts,e)},yp.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=ra(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};var bp={__depends__:[vp],__init__:["autoScroll"],autoScroll:["type",yp]};function _p(e){this._commandStack=e.get("commandStack",!1)}_p.$inject=["injector"],_p.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),void 0===n||n};var xp={__init__:["rules"],rules:["type",_p]},wp=Math.round,Ep=Math.max;function Sp(e,t){return function(e,t){var n,i;for(n=0;i=e[n];n++)if(wt(i,t)<=10)return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||function(e,t){var n,i,r=Jt(function(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}(t,10),(n=[],e.forEach((function(e,t){n.push([0===t?"M":"L",e.x,e.y])})),n)),o=r[0],a=r[r.length-1];return o?o!==a?o.segment2!==a.segment2?{point:e[i=Ep(o.segment2,a.segment2)-1],bendpoint:!0,index:i}:{point:{x:wp(o.x+a.x)/2,y:wp(o.y+a.y)/2},index:o.segment2}:{point:{x:wp(o.x),y:wp(o.y)},index:o.segment2}:null}(e,t)}function Cp(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function kp(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Rp(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}];return-(i[0].n*t[0]+i[1].n*t[1])/(i[0].lambda*t[0]+i[1].lambda*t[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Pp(e,t){var n=Rp(e,t);return Cp({x:n.x-e.x,y:n.y-e.y})}function Ap(e,t){return Cp({x:e.x-t.x,y:e.y-t.y})}var Mp="djs-bendpoint",Tp="djs-segment-dragger";function Dp(e,t,n){var i=function(e,t){var n,i=ra(t),r=e._container.getBoundingClientRect();n={x:r.left,y:r.top};var o=e.viewbox();return{x:o.x+(i.x-n.x)/o.scale,y:o.y+(i.y-n.y)/o.scale}}(e,n);return Sp(t,i)}function Bp(e,t){var n=Ae("g");we(n).add(Mp),ye(e,n);var i=Ae("circle");_e(i,{cx:0,cy:0,r:4}),we(i).add("djs-visual"),ye(n,i);var r=Ae("circle");return _e(r,{cx:0,cy:0,r:10}),we(r).add("djs-hit"),ye(n,r),t&&we(n).add(t),n}function Np(e,t,n,i){var r=Ae("g");ye(e,r);var o=function(e,t,n){var i=t.x-e.x,r=t.y-e.y;return Op("h"===n?i:r)}(t,n,i),a=Ae("rect");_e(a,{x:-9,y:-3,width:18,height:6}),we(a).add("djs-visual"),ye(r,a);var s=Ae("rect");return _e(s,{x:-o/2,y:-8.5,width:o,height:17}),we(s).add("djs-hit"),ye(r,s),Un(r,"v"===i?90:0),r}function jp(e,t,n){var i=Ae("g"),r=Rt(t,n),o=St(t,n);return ye(e,i),Np(i,t,n,o),we(i).add(Tp),we(i).add("h"===o?"horizontal":"vertical"),Wn(i,r.x,r.y),i}function Op(e){return Math.abs(Math.round(2*e/3))}function Lp(e,t){var n=function(e,t){for(var n,i=t.waypoints,r=1/0,o=0;o<i.length-1;o++){var a=Pp(e,[i[o],i[o+1]]);a<r&&(r=a,n=o)}return[i[n],i[n+1]]}(e,t);return Rp(e,n)}function $p(e,t,n,i,r){function o(e,n){var o,a=n.waypoints,s=Dp(t,a,e);if(s)return o=function(e,t){var n,i,r=e.waypoints;return t.index<=0||t.bendpoint?null:(i=St((n={start:r[t.index-1],end:r[t.index]}).start,n.end))?Op("h"===i?n.end.x-n.start.x:n.end.y-n.start.y)/2:null}(n,s),!function(e,t,n){var i,r,o,a,s,c,p=e.index,l=e.point;return!(p<=0||e.bendpoint)&&(o=Rt(i=t[p-1],r=t[p]),a=St(i,r),s=Math.abs(l.x-o.x),c=Math.abs(l.y-o.y),a&&s<=n&&c<=n)}(s,a,o)?i.start(e,n,s.index,!s.bendpoint):r.start(e,n,s.index),!0}function a(e,t,i){oe.bind(e,t,(function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()}))}function s(e,n){var i=t.getLayer("overlays"),r=fe('.djs-bendpoints[data-element-id="'+Oo(e.id)+'"]',i);return!r&&n&&(_e(r=Ae("g"),{"data-element-id":e.id}),we(r).add("djs-bendpoints"),ye(i,r),a(r,"mousedown",e),a(r,"click",e),a(r,"dblclick",e)),r}function c(e,t){return fe('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function p(e,t){t.waypoints.forEach((function(t,n){var i=Bp(e);ye(e,i),Wn(i,t.x,t.y)})),Bp(e,"floating")}function l(e,t){for(var n,i,r,o=t.waypoints,s=1;s<o.length;s++)St(n=o[s-1],i=o[s])&&(_e(r=jp(e,n,i),{"data-segment-idx":s}),a(r,"mousemove",t))}function u(e){var t=s(e);return t||(p(t=s(e,!0),e),l(t,e)),t}function h(e){var t=s(e);t&&(!function(e){g(me("."+Tp,e),(function(e){Fe(e)}))}(t),function(e){g(me("."+Mp,e),(function(e){Fe(e)}))}(t),l(t,e),p(t,e))}function d(e,t,n){var i,r,o=c(t.index,e),a=n[t.index-1],s=n[t.index],p=t.point,l=Rt(a,s),u=St(a,s);o&&(i=function(e){return fe(".djs-visual",e)}(o),r={x:p.x-l.x,y:p.y-l.y},"v"===u&&(r={x:r.y,y:r.x}),Wn(i,r.x,r.y))}e.on("connection.changed",(function(e){h(e.element)})),e.on("connection.remove",(function(e){var t=s(e.element);t&&Fe(t)})),e.on("element.marker.update",(function(e){var t,n=e.element;n.waypoints&&(t=u(n),e.add?we(t).add(e.marker):we(t).remove(e.marker))})),e.on("element.mousemove",(function(e){var n,i,r=e.element,o=r.waypoints;if(o){if(n=s(r,!0),!(i=Dp(t,o,e.originalEvent)))return;!function(e,t){var n=fe(".floating",e),i=t.point;n&&Wn(n,i.x,i.y)}(n,i),i.bendpoint||d(n,i,o)}})),e.on("element.mousedown",(function(e){if(sa(e)){var t=e.originalEvent,n=e.element;if(n.waypoints)return o(t,n)}})),e.on("selection.changed",(function(e){var t=e.newSelection[0];t&&t.waypoints&&u(t)})),e.on("element.hover",(function(e){var t=e.element;t.waypoints&&(u(t),n.registerEvent(e.gfx,"mousemove","element.mousemove"))})),e.on("element.out",(function(e){n.unregisterEvent(e.gfx,"mousemove","element.mousemove")})),e.on("element.updateId",(function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=s(t);i&&_e(i,{"data-element-id":n})}})),this.addHandles=u,this.updateHandles=h,this.getBendpointsContainer=s,this.getSegmentDragger=c}$p.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var Ip=Math.round,Fp="reconnectStart",zp="reconnectEnd",Hp="updateWaypoints";function Vp(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,a){var s,c=n.getGraphics(t),p=t.source,l=t.target,u=t.waypoints,h=(s=a||0!==o?a||o!==u.length-1?Hp:zp:Fp)===Hp?"connection.updateWaypoints":"connection.reconnect",d=r.allowed(h,{connection:t,source:p,target:l});!1===d&&(d=r.allowed(h,{connection:t,source:l,target:p})),!1!==d&&i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:{allowed:d,bendpointIndex:o,connection:t,source:p,target:l,insert:a,type:s}}})},t.on("bendpoint.move.hover",(function(e){var t,n=e.context,i=n.connection,o=i.source,a=i.target,s=e.hover,c=n.type;if(n.hover=s,s){var p=c===Hp?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(p,{connection:i,source:c===Fp?s:o,target:c===zp?s:a}))return n.source=c===Fp?s:o,void(n.target=c===zp?s:a);!1===t&&(t=n.allowed=r.allowed(p,{connection:i,source:c===zp?s:a,target:c===Fp?s:o})),t&&(n.source=c===zp?s:a,n.target=c===Fp?s:o)}})),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],(function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==Hp&&(t.allowed=!1)})),t.on("bendpoint.move.end",(function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,a=t.insert,s=r.waypoints.slice(),c=t.source,p=t.target,l=t.type,u=t.hints||{},h={x:Ip(e.x),y:Ip(e.y)};if(!n)return!1;l===Hp?(a?s.splice(i,0,h):s[i]=h,u.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(r,s),o.updateWaypoints(r,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===wt(t,i=e[r+1])||Et(n,i,t)?e.splice(r,1):r++;return e}(s),u)):(l===Fp?(u.docking="source",Gp(t)&&(u.docking="target",u.newWaypoints=s.reverse())):l===zp&&(u.docking="target",Gp(t)&&(u.docking="source",u.newWaypoints=s.reverse())),o.reconnect(r,c,p,h,u))}),this)}function Gp(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===Fp?t&&i&&t===i&&n!==i:r===zp?t&&n&&t===n&&n!==i:void 0}Vp.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Vp.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var Wp="updateWaypoints",Up="connect-ok",qp="connect-not-ok",Kp="connect-hover",Yp="djs-updating",Xp="djs-dragging";function Zp(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",(function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,a=r.waypoints,s=a.slice();t.waypoints=a,o&&s.splice(n,0,{x:e.x,y:e.y}),r.waypoints=s,we(t.draggerGfx=Bp(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(r,Xp),i.addMarker(r,Yp)})),n.on("bendpoint.move.hover",(function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,Kp),o===Wp)return;n?(i.removeMarker(r,qp),i.addMarker(r,Up)):!1===n&&(i.removeMarker(r,Up),i.addMarker(r,qp))}})),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,(function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,Kp),i.removeMarker(n,r?Up:qp))})),n.on("bendpoint.move.move",(function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,a=n.draggerGfx,s=n.hover,c=n.type,p=n.connection,l=p.source,u=p.target,h=p.waypoints.slice(),d={x:t.x,y:t.y},f=n.hints||{},m={};r&&(f.connectionStart&&(m.connectionStart=f.connectionStart),f.connectionEnd&&(m.connectionEnd=f.connectionEnd),"reconnectStart"===c?Gp(n)?(m.connectionEnd=m.connectionEnd||d,m.source=u,m.target=s||l,h=h.reverse()):(m.connectionStart=m.connectionStart||d,m.source=s||l,m.target=u):"reconnectEnd"===c?Gp(n)?(m.connectionStart=m.connectionStart||d,m.source=s||u,m.target=l,h=h.reverse()):(m.connectionEnd=m.connectionEnd||d,m.source=l,m.target=s||u):(m.noCropping=!0,m.noLayout=!0,h[o]=d),c===Wp&&(h=e.cropWaypoints(p,h)),m.waypoints=h,r.drawPreview(n,i,m)),Wn(a,t.x,t.y)}),this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,(function(e){var t=e.context,n=t.connection,o=t.draggerGfx,a=t.hover,s=t.target,c=t.waypoints;n.waypoints=c,Fe(o),i.removeMarker(n,Yp),i.removeMarker(n,Xp),a&&(i.removeMarker(a,Up),i.removeMarker(a,s?Up:qp)),r&&r.cleanUp(t)}))}Zp.$inject=["bendpointMove","injector","eventBus","canvas"];var Qp="connect-hover",Jp="djs-updating";function el(e,t,n){return tl(e,t,e[t]+n)}function tl(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function nl(e){return"x"===e?"y":"x"}function il(e,t,n){var i,r;return e.original?e.original:(i=fn(t),tl(e,r=nl(n),i[r]))}function rl(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(e,t){if(!a)return t;var n,i=e.waypoints;return e.waypoints=t,n=a.getCroppedWaypoints(e),e.waypoints=i,n}function c(e){r.update("connection",e.connection,e.connectionGfx)}function p(e,t,n){var i=e.newWaypoints,r=function(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]);return tl(t,i,Math.min(Math.max(o+20,e[i]),r-20))}(n,i[e.segmentStartIndex+t],i[e.segmentEndIndex+t],nl(e.axis));Wn(e.draggerGfx,r.x,r.y)}this.start=function(e,t,r){var o,a,s,c,p=n.getGraphics(t),l=r-1,u=r,h=t.waypoints,d=h[l],f=h[u],m=Dp(n,h,e);(a=St(d,f))&&(s="v"===a?"x":"y",0===l&&(d=il(d,t.source,s)),u===h.length-1&&(f=il(f,t.target,s)),o={connection:t,segmentStartIndex:l,segmentEndIndex:u,segmentStart:d,segmentEnd:f,axis:s,dragPosition:c=m?m.point:{x:(d.x+f.x)/2,y:(d.y+f.y)/2}},i.init(e,c,"connectionSegment.move",{cursor:"x"===s?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:p,context:o}}))},t.on("connectionSegment.move.start",(function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=jp(r,t.segmentStart,t.segmentEnd),we(t.draggerGfx).add("djs-dragging"),n.addMarker(i,Jp)})),t.on("connectionSegment.move.move",(function(e){var t,n,i=e.context,r=i.connection,o=i.segmentStartIndex,a=i.segmentEndIndex,l=i.segmentStart,u=i.segmentEnd,h=i.axis,d=i.originalWaypoints.slice(),f=el(l,h,e["d"+h]),m=el(u,h,e["d"+h]),v=d.length,y=0;d[o]=f,d[a]=m,o<2&&(t=mn(r.source,f),1===o?"intersect"===t&&(d.shift(),d[0]=f,y--):"intersect"!==t&&(d.unshift(l),y++)),a>v-3&&(n=mn(r.target,m),a===v-2?"intersect"===n&&(d.pop(),d[d.length-1]=m):"intersect"!==n&&d.push(u)),i.newWaypoints=r.waypoints=s(r,d),p(i,y,e),i.newSegmentStartIndex=o+y,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,Qp)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,Qp)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&Fe(t.draggerGfx),n.removeMarker(i,Jp)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex;i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}));var a=function(e,t){var n=0,i=e.filter((function(i,r){return!Et(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)}));return{waypoints:i,segmentOffset:n}}(i,r),c=s(n,a.waypoints),p=a.segmentOffset,l={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,c,l)}))}rl.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var ol=Math.abs,al=Math.round;function sl(e){return{x:e.x,y:e.y}}function cl(e){return{x:e.x+e.width,y:e.y+e.height}}function pl(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:al(e.x+e.width/2),y:al(e.y+e.height/2)}}function ll(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function ul(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function hl(e){return e.children||[]}var dl=Math.abs,fl=Math.round;function ml(e){function t(e,t){if(p(e)){for(var n=e.length;n--;)if(dl(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e,t){return e.waypoints?Lp(t,e):e.width?{x:fl(e.width/2+e.x),y:fl(e.height/2+e.y)}:void 0}e.on("connectionSegment.move.move",1500,(function(e){var i,r,o=function(e){var t=e.context,i=t.snapPoints,r=t.connection,o=r.waypoints,a=t.segmentStart,s=t.segmentStartIndex,c=t.segmentEnd,p=t.segmentEndIndex,l=t.axis;if(i)return i;var u=[o[s-1],a,c,o[p+1]];return s<2&&u.unshift(n(r.source,e)),p>o.length-3&&u.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},g(u,(function(e){e&&(e=e.original||e,"y"===l&&i.horizontal.push(e.y),"x"===l&&i.vertical.push(e.x))})),i}(e),a=e.x,s=e.y;if(o){var c=a-(i=t(o.vertical,a)),p=s-(r=t(o.horizontal,s));L(e,{dx:e.dx-c,dy:e.dy-p,x:i,y:r}),(c||-1!==o.vertical.indexOf(a))&&ul(e,"x",i),(p||-1!==o.horizontal.indexOf(s))&&ul(e,"y",r)}})),e.on(["connect.hover","connect.move","connect.end"],1500,(function(e){var t=e.context.hover,i=t&&n(t,e);sn(t)&&i&&i.x&&i.y&&(ul(e,"x",i.x),ul(e,"y",i.y))})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},g(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}(o),s=o.hover,c=s&&n(s,e),p=e.x,l=e.y;if(a){var u=p-(i=t(c?a.vertical.concat([c.x]):a.vertical,p)),h=l-(r=t(c?a.horizontal.concat([c.y]):a.horizontal,l));L(e,{dx:e.dx-u,dy:e.dy-h,x:e.x-u,y:e.y-h}),(u||-1!==a.vertical.indexOf(p))&&ul(e,"x",i),(h||-1!==a.horizontal.indexOf(l))&&ul(e,"y",r)}}))}ml.$inject=["eventBus"];var vl={__depends__:[vp,xp],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",$p],bendpointMove:["type",Vp],bendpointMovePreview:["type",Zp],connectionSegmentMove:["type",rl],bendpointSnapping:["type",ml]};function yl(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!c(t=n.canExecute=r(i,o))){if(!1!==t)return n.source=i,void(n.target=o);c(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,p={connectionStart:gl(t)?o:r,connectionEnd:gl(t)?r:o};l(i)&&(c=i),t.connection=n.connect(a,s,c,p)})),this.start=function(e,n,i,r){l(i)||(r=i,i=fn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function gl(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}yl.$inject=["eventBus","dragging","modeling","rules"];var bl="connect-ok",_l="connect-not-ok";function xl(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,p=t.connectionStart||s,l=t.connectionEnd||{x:e.x,y:e.y},u=p,h=l;gl(t)&&(u=l,h=p),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:u,connectionEnd:h})})),t.on("connect.hover",900,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?bl:_l)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){var t=e.hover;t&&(n.removeMarker(t,bl),n.removeMarker(t,_l))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}xl.$inject=["injector","eventBus","canvas"];var wl={__depends__:[_a,xp,vp],__init__:["connectPreview"],connect:["type",yl],connectPreview:["type",xl]};function El(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}El.$inject=["injector","canvas","graphicsFactory","elementFactory"],El.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,p=n.target,l=n.waypoints,u=n.connectionStart,h=n.connectionEnd,d=n.noLayout,f=n.noCropping,m=n.noNoop,v=this;a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Se(a),s||(s=e.getConnection=(r=function(e,t,n){return v.getConnection(e,t,n)},o={},function(e){var t=JSON.stringify(e),n=o[t];return n||(n=o[t]=r.apply(null,arguments)),n})),t&&(i=s(t,c,p)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:c,target:p,connectionStart:u,connectionEnd:h,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[c?fn(c):u,p?fn(p):h]),this._connectionDocking&&(c||p)&&!f&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,c,p)),this._graphicsFactory.drawConnection(a,i,{stroke:"var(--element-dragger-color)"})):!m&&this.drawNoopPreview(a,n)},El.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fn(n),o=t.connectionEnd||fn(i),a=this.cropWaypoints(r,o,n,i);ye(e,this.createNoopConnection(a[0],a[1]))},El.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&vn(o,s,!0)||e,t=i&&vn(a,s,!1)||t]},El.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Fe(e.connectionPreviewGfx)},El.prototype.getConnection=function(e){var t=function(e){return l(e)?e:{}}(e);return this._elementFactory.createConnection(t)},El.prototype.createConnectionPreviewGfx=function(){var e=Ae("g");return _e(e,{pointerEvents:"none"}),we(e).add("djs-dragger"),ye(this._canvas.getActiveLayer(),e),e},El.prototype.createNoopConnection=function(e,t){return ot([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};var Sl={__init__:["connectionPreview"],connectionPreview:["type",El]};const Cl=new Eo("ps");var kl=["marker-start","marker-mid","marker-end"],Rl=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Pl(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}Pl.$inject=["elementRegistry","eventBus","canvas","styles"],Pl.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},Pl.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Pl.prototype.addDragger=function(e,t,n,i="djs-dragger"){var r=Ce(n=n||this.getGfx(e)),o=n.getBoundingClientRect();return this._cloneMarkers(Vn(r),i),_e(r,this._styles.cls(i,[],{x:o.top,y:o.left})),ye(t,r),_e(r,"data-preview-support-element-id",e.id),r},Pl.prototype.addFrame=function(e,t){var n=Ae("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ye(t,n),_e(n,"data-preview-support-element-id",e.id),n},Pl.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;e.childNodes&&e.childNodes.forEach((e=>{i._cloneMarkers(e,t,n)})),function(e){return-1!==Rl.indexOf(e.nodeName)}(e)&&kl.forEach((function(r){if(_e(e,r)){var o=function(e,t,n){var i=(r=_e(e,t),r.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]);var r;return fe("marker#"+i,n||document)}(e,r,i._canvas.getContainer());o&&i._cloneMarker(n,e,o,r,t)}}))},Pl.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,Cl.next()].join("-"),a=fe("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||Ce(n);s.id=o,we(s).add(r);var c=fe(":scope > defs",e);c||ye(e,c=Ae("defs")),ye(c,s),_e(t,i,"url(#"+s.id+")")};var Al={__init__:["previewSupport"],previewSupport:["type",Pl]};const Ml="complex-preview";class Tl{constructor(e,t,n){this._canvas=e,this._graphicsFactory=t,this._previewSupport=n,this._markers=[]}create(e){this.cleanUp();const{created:t=[],moved:n=[],removed:i=[],resized:r=[]}=e,o=this._canvas.getLayer(Ml);t.filter((e=>!function(e){return e.hidden}(e))).forEach((e=>{let t;sn(e)?(t=this._graphicsFactory._createContainer("connection",Ae("g")),this._graphicsFactory.drawConnection(Vn(t),e)):(t=this._graphicsFactory._createContainer("shape",Ae("g")),this._graphicsFactory.drawShape(Vn(t),e),Wn(t,e.x,e.y)),this._previewSupport.addDragger(e,o,t)})),n.forEach((({element:e,delta:t})=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"]);const n=this._previewSupport.addDragger(e,o);sn(e)?Wn(n,t.x,t.y):Wn(n,e.x+t.x,e.y+t.y)})),i.forEach((e=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"])})),r.forEach((({shape:e,bounds:t})=>{this._canvas.addMarker(e,"djs-hidden"),this._markers.push([e,"djs-hidden"]),this._previewSupport.addDragger(e,o,void 0,"djs-dragging");const n=this._graphicsFactory._createContainer("shape",Ae("g"));this._graphicsFactory.drawShape(Vn(n),e,{width:t.width,height:t.height}),Wn(n,t.x,t.y),this._previewSupport.addDragger(e,o,n)}))}cleanUp(){Se(this._canvas.getLayer(Ml)),this._markers.forEach((([e,t])=>this._canvas.removeMarker(e,t))),this._markers=[]}show(){this._canvas.showLayer(Ml)}hide(){this._canvas.hideLayer(Ml)}}Tl.$inject=["canvas","graphicsFactory","previewSupport"];var Dl={__depends__:[Al],__init__:["complexPreview"],complexPreview:["type",Tl]},Bl=["top","bottom","left","right"],Nl=10;function jl(e,t){function n(e){if(Hr(e)&&!sn(e)){var n=function(e){var t=fn(e.label),n=fn(e),i=Ol(n,t);if(r=i,-1===Bl.indexOf(r))return;var r;var o=function(e){var t=fn(e),n=[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return Ol(t,e)}));return n}(e);if(e.host){var a=function(e){var t,n=e.host,i=fn(e),r=mn(i,n);t=r.indexOf("-")>=0?r.split("-"):[r];var o=Bl.filter((function(e){return-1===t.indexOf(e)}));return o}(e);o=o.concat(a)}var s=Bl.filter((function(e){return-1===o.indexOf(e)}));if(-1!==s.indexOf(i))return;return s[0]}(e);n&&function(e,n){var i=fn(e),r=e.label,o=fn(r);if(!r.parent)return;var a,s=un(e);switch(n){case"top":a={x:i.x,y:s.top-Nl-r.height/2};break;case"left":a={x:s.left-Nl-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+Nl+r.height/2};break;case"right":a={x:s.right+Nl+r.width/2,y:i.y}}var c=Ha(a,o);t.moveShape(r,c)}(e,n)}}Do.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function Ol(e,t){return mn(t,e,5)}function Ll(e){Do.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(vr(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function $l(e,t){e.invoke(Do,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape;g(y(i.incoming.concat(i.outgoing),(function(e){return vr(e,"bpmn:Association")})),(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}e(jl,Do),jl.$inject=["eventBus","modeling"],e(Ll,Do),Ll.$inject=["eventBus"],e($l,Do),$l.$inject=["injector","modeling"];function Il(e,t){t.invoke(Do,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return Fl(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n._replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];Fl(r,i)&&(e.shapes=[n._replaceShape(r,i)])}}),!0)}function Fl(e,t){return!cn(e)&&yr(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function zl(e,t){function n(e){return y(e.attachers,(function(e){return vr(e,"bpmn:BoundaryEvent")}))}Do.call(this,e),this.postExecute("connection.create",(function(e){var i=e.context.source,r=e.context.target,o=n(r);vr(i,"bpmn:EventBasedGateway")&&vr(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var i=e.context.oldSource,r=e.context.newSource;vr(i,"bpmn:Gateway")&&vr(r,"bpmn:EventBasedGateway")&&g(r.outgoing,(function(e){var i=e.target,r=n(i);vr(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}))}))}function Hl(e,t,n){function i(e){t.updateProperties(e,{isForCompensation:!0})}function r(e){t.updateProperties(e,{isForCompensation:void 0})}Do.call(this,e),this.preExecute("shape.replace",(function(e){const{newData:n,oldShape:i}=e;if(Gl(e.oldShape)&&"bpmn:CompensateEventDefinition"!==n.eventDefinitionType||"bpmn:BoundaryEvent"!==n.type){const t=i.outgoing.find((({target:e})=>Vl(e)));t&&t.target&&(e._connectionTarget=t.target)}else if(!Gl(e.oldShape)&&"bpmn:CompensateEventDefinition"===n.eventDefinitionType&&"bpmn:BoundaryEvent"===n.type){const n=i.outgoing.find((({target:e})=>Wl(e)));n&&n.target&&(e._connectionTarget=n.target),function(e){const n=e.outgoing.filter((e=>vr(e,"bpmn:SequenceFlow")));t.removeElements(n)}(i)}}),!0),this.postExecuted("shape.replace",(function(e){const{_connectionTarget:n,newShape:i}=e;n&&t.connect(i,n)}),!0),this.preExecute("connection.create",(function(e){const n=e.connection,r=e.source,o=e.target;Gl(r)&&Wl(o)&&(i(o),function(e,n){const i=e.outgoing.filter((e=>vr(e,"bpmn:Association"))),r=i.filter((e=>Vl(e.target)&&!n.includes(e)));r.forEach((e=>t.removeConnection(e)))}(r,[n]))}),!0),this.postExecuted("connection.delete",(function(e){const t=e.source,n=e.target;Gl(t)&&Vl(n)&&r(n)}),!0),this.postExecuted("connection.reconnect",(function(e){const t=e.newTarget,n=e.oldSource,o=e.oldTarget;if(o!==t){const e=n;Vl(o)&&r(o),Gl(e)&&Wl(t)&&i(t)}}),!0),this.postExecuted("element.updateProperties",(function(e){const{element:i}=e;Vl(i)?(function(e){for(const i of e.incoming)n.canConnect(i.source,e)||t.removeConnection(i);for(const i of e.outgoing)n.canConnect(e,i.target)||t.removeConnection(i)}(i),function(e){const n=e.attachers.slice();if(!n.length)return;t.removeElements(n)}(i)):Wl(i)&&function(e){const n=e.incoming.filter((e=>Gl(e.source)));t.removeElements(n)}(i)}),!0)}function Vl(e){const t=gr(e);return t&&t.get("isForCompensation")}function Gl(e){return e&&vr(e,"bpmn:BoundaryEvent")&&Ir(e,"bpmn:CompensateEventDefinition")}function Wl(e){return e&&vr(e,"bpmn:Activity")&&!$r(e)}function Ul(e){e.invoke(Do,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;vr(n,"bpmn:Lane")&&!vr(i,"bpmn:Lane")&&(t.parent=Jc(n,"bpmn:Participant"))}))}function ql(e,t){Do.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context.shape;if(vr(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}}))}Il.$inject=["bpmnReplace","injector"],e(Il,Do),Il.prototype._replaceShape=function(e,t){var n,i=(n=gr(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})},zl.$inject=["eventBus","modeling"],e(zl,Do),e(Hl,Do),Hl.$inject=["eventBus","modeling","bpmnRules"],Ul.$inject=["injector"],e(Ul,Do),ql.$inject=["eventBus","bpmnFactory"],e(ql,Do);var Kl=20,Yl=20,Xl=2e3;function Zl(e,t,n){function i(){var t=e.getRootElement();return vr(t,"bpmn:Collaboration")?t:n.makeCollaboration()}Do.call(this,t),t.on(["create.start","shape.move.start"],Xl,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(vr(i,"bpmn:Participant")&&vr(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!vr(e,"bpmn:Group")&&!cn(e)&&!sn(e)}));if(o.length){var a=ht(o),s=function(e,t){t={width:t.width+40+30,height:t.height+40};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}(i,a);L(i,s),n.createConstraints=function(e,t){return t=un(t),{bottom:t.top+e.height/2-Yl,left:t.right-e.width/2+Kl,top:t.bottom-e.height/2+Yl,right:t.left+e.width/2-Kl-30}}(i,a)}}})),t.on("create.start",Xl,(function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}vr(i,"bpmn:Participant")&&vr(r,"bpmn:Process")&&(t.on("element.hover",Xl,a),t.once("create.cleanup",(function(){t.off("element.hover",a)})))})),this.preExecute("elements.create",Xl,(function(e){var t,n=e.elements,r=e.parent,o=function(e){return m(e,(function(e){return vr(e,"bpmn:Participant")}))}(n);o&&vr(r,"bpmn:Process")&&(e.parent=i(),(t=e.hints=e.hints||{}).participant=o,t.process=r,t.processRef=gr(o).get("processRef"))}),!0),this.preExecute("shape.create",(function(e){var t=e.parent,n=e.shape;vr(n,"bpmn:Participant")&&vr(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=gr(n).get("processRef"))}),!0),this.execute("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;!n||r&&i!==r||gr(i).set("processRef",gr(n))}),!0),this.revert("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;!n||o&&r!==o||gr(r).set("processRef",i)}),!0),this.postExecute("shape.create",(function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var a=i.children.slice();o?r===o&&n.moveElements(a,{x:0,y:0},o):n.moveElements(a,{x:0,y:0},r)}}),!0)}Zl.$inject=["canvas","eventBus","modeling"],e(Zl,Do);var Ql="__targetRef_placeholder";function Jl(e,t){function n(e,n){var i=e.get("properties"),r=m(i,(function(e){return e.name===Ql}));return!r&&n&&_t(i,r=t.create("bpmn:Property",{name:Ql})),r}function i(e,t){var i=n(e);i&&(function(e,t,n){return m(e.get("dataInputAssociations"),(function(e){return e!==n&&e.targetRef===t}))}(e,i,t)||bt(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,l=p&&p.businessObject,u=r.oldTarget||r.target,h=u&&u.businessObject,d=o.businessObject;h&&h!==c&&i(h,a),l&&l!==c&&i(l,a),c?(t=n(c,!0),d.targetRef=t):d.targetRef=null}Do.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],eu(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],eu(r))}function eu(e){return function(t){if(vr(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function tu(e){this._bpmnUpdater=e}function nu(e,t,n,i){function r(e){return e.children.filter((function(e){return vr(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter((function(e){return vr(e,"bpmn:Participant")&&gr(e).processRef}))[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,dataStoreDi:br(e),newSemanticParent:o.processRef||o,newDiParent:br(i)})}}Do.call(this,i),t.registerHandler("dataStore.updateContainment",tu),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;vr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes;n.filter((function(e){return vr(e,"bpmn:DataStoreReference")})).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!vr(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context.shape,n=t.parent;vr(t,"bpmn:DataStoreReference")&&"label"!==t.type&&vr(n,"bpmn:Collaboration")&&o(t)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;vr(i,"bpmn:Collaboration")||vr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&vr(r,"bpmn:Collaboration")&&o(n,vr(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(vr(e.parent,t))return e.parent;e=e.parent}}(i,"bpmn:Participant"))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape,i=e.getRootElement();yr(n,["bpmn:Participant","bpmn:SubProcess"])&&vr(i,"bpmn:Collaboration")&&r(i).filter((function(e){return function(e,t){var n=e.businessObject||e,i=t.businessObject||t;for(;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)})).forEach((function(e){o(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach((function(e){vr(i,"bpmn:Process")&&o(e,i)}))}))}Jl.$inject=["eventBus","bpmnFactory"],e(Jl,Do),tu.$inject=["bpmnUpdater"],tu.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},tu.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},nu.$inject=["canvas","commandStack","elementRegistry","eventBus"],e(nu,Do);var iu=Math.max,ru=Math.min;function ou(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function au(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return u(r)&&(i=(/top|left/.test(e)?ru:iu)(i,r)),u(o)&&(i=(/top|left/.test(e)?iu:ru)(i,o)),i}function su(e,t){return void 0!==e?e:20}function cu(e){return!e.waypoints&&"label"!==e.type}function pu(e,t){var n;if((n=void 0===e.length?y(e.children,cu):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=su(t.left),i=su(t.right),r=su(t.top),o=su(t.bottom)):n=i=r=o=su(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}(ht(n),t)}var lu=Math.abs;var uu=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],hu=30;function du(e,t){return t=t||[],e.children.filter((function(e){vr(e,"bpmn:Lane")&&(du(e,t),t.push(e))})),t}function fu(e){return e.children.filter((function(e){return vr(e,"bpmn:Lane")}))}function mu(e){return Jc(e,uu)||e}function vu(e,t){var n=mu(e),i=du(n,vr(n,"bpmn:Process")?[]:[n]),r=un(e),o=un(t),a=function(e,t){return ou(un(t),un(e))}(e,t),s=[],c=Lr(e);return i.forEach((function(t){if(t!==e){var n,i,p=c?0:a.top,l=c?a.right:0,u=c?0:a.bottom,h=c?a.left:0,d=un(t);a.top&&(lu(d.bottom-r.top)<10&&(u=o.top-d.bottom),lu(d.top-r.top)<5&&(p=o.top-d.top)),a.left&&(lu(d.right-r.left)<10&&(l=o.left-d.right),lu(d.left-r.left)<5&&(h=o.left-d.left)),a.bottom&&(lu(d.top-r.bottom)<10&&(p=o.bottom-d.top),lu(d.bottom-r.bottom)<5&&(u=o.bottom-d.bottom)),a.right&&(lu(d.left-r.right)<10&&(h=o.right-d.left),lu(d.right-r.right)<5&&(l=o.right-d.right)),(p||l||u||h)&&s.push({shape:t,newBounds:(n=t,i={top:p,right:l,bottom:u,left:h},{x:n.x+(i.left||0),y:n.y+(i.top||0),width:n.width-(i.left||0)+(i.right||0),height:n.height-(i.top||0)+(i.bottom||0)})})}})),s}function yu(e,t){Do.call(this,e),this.postExecuted("shape.delete",500,(function(e){var n=e.context,i=n.hints,r=n.shape,o=n.oldParent;vr(r,"bpmn:Lane")&&(i&&i.nested||function(e,n){var i,r,o,a,s,c=Lr(e),p=fu(n),l=[],u=[],h=[],d=[];lt(p,(function(t){return c?t.y>e.y?u.push(t):l.push(t):t.x>e.x?d.push(t):h.push(t),t.children})),p.length&&(i=c?u.length&&l.length?e.height/2:e.height:d.length&&h.length?e.width/2:e.width,l.length&&(r=t.calculateAdjustments(l,"y",i,e.y-10),t.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),u.length&&(o=t.calculateAdjustments(u,"y",-i,e.y+e.height+10),t.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")),h.length&&(a=t.calculateAdjustments(h,"x",i,e.x-10),t.makeSpace(a.movingShapes,a.resizingShapes,{x:i,y:0},"e")),d.length&&(s=t.calculateAdjustments(d,"x",-i,e.x+e.width+10),t.makeSpace(s.movingShapes,s.resizingShapes,{x:-i,y:0},"w")))}(r,o))}))}yu.$inject=["eventBus","spaceTool"],e(yu,Do);function gu(e,t){t.invoke(Do,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return bu(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n._replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o,a=e.host;bu(e,(o=a,-1!==t.indexOf(o)?a:i))&&(t[r]=n._replaceShape(e))}))}),!0)}function bu(e,t){return!cn(e)&&vr(e,"bpmn:BoundaryEvent")&&!t}function _u(e,t,n){function i(e,i,r){var o,a,s,c,p,l,h,d,f=i.waypoints,m=e.outgoing.slice(),v=e.incoming.slice(),g=Sp(f,d=u(r.width)?fn(r):r);if(g){if(o=f.slice(0,g.index),a=f.slice(g.index+(g.bendpoint?1:0)),!o.length||!a.length)return;s=g.bendpoint?f[g.index]:d,1!==o.length&&xu(e,o[o.length-1])||o.push(wu(s)),1!==a.length&&xu(e,a[0])||a.unshift(wu(s))}c=i.source,p=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||d),l=i),t.canConnect(e,p,i)&&(l?h=n.connect(e,p,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||d),h=i));var b=[].concat(l&&y(v,(function(e){return e.source===l.source}))||[],h&&y(m,(function(e){return e.target===h.target}))||[]);b.length&&n.removeElements(b)}Do.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=fn(o),s={x:a.x+r.x,y:a.y+r.y},c=m(n.children,(function(e){return t.canInsert(i,e)&&Sp(e.waypoints,s)}));c&&(e.targetFlow=c,e.position=s)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function xu(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function wu(e){return L({},e)}function Eu(e,t){Do.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.connection,r=n.source,o=n.target,a=n.hints;if((!a||!1!==a.createElementsBehavior)&&Su(i)){(vr(r,"bpmn:EventBasedGateway")?o.incoming.filter((e=>e!==i&&Su(e))):o.incoming.filter((e=>e!==i&&Su(e)&&vr(e.source,"bpmn:EventBasedGateway")))).forEach((function(e){t.removeConnection(e)}))}})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;vr(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(Su).reduce((function(e,t){return e.includes(t.target)?e:e.concat(t.target)}),[]).forEach((function(e){e.incoming.filter(Su).forEach((function(i){const r=e.incoming.filter(Su).filter((function(e){return e.source===n}));(i.source!==n||r.length>1)&&t.removeConnection(i)}))}))}))}function Su(e){return vr(e,"bpmn:SequenceFlow")}gu.$inject=["bpmnReplace","injector"],e(gu,Do),gu.prototype._replaceShape=function(e){var t,n,i=(n=gr(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},e(_u,Do),_u.$inject=["eventBus","bpmnRules","modeling"],Eu.$inject=["eventBus","modeling"],e(Eu,Do);var Cu=1500;function ku(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Cu,(function(t){var i=t.context.shape||t.shape,r=t.hover;vr(r,"bpmn:Lane")&&!yr(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=mu(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r!==o&&(i.labelTarget||yr(i,["bpmn:Group","bpmn:TextAnnotation"]))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Cu,(function(t){var n=t.hover;vr(n,"bpmn:Lane")&&(t.hover=mu(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],Cu,(function(t){var n=t.context,i=t.hover,r=n.type;vr(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=mu(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],Cu,(function(e){var t=e.context,n=t.start;vr(n,"bpmn:Lane")&&(t.start=mu(n)||n)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;vr(t,"bpmn:Lane")&&(e.shape=mu(t)||t)})),t.on("spaceTool.move",2e3,(function(e){var t=e.hover;t&&vr(t,"bpmn:Lane")&&(e.hover=mu(t))}))}ku.$inject=["elementRegistry","eventBus","canvas"];function Ru(e,t,n,i,r,o){function a(e,t,i){var r=n.filter((function(e){return vr(e,"bpmn:Group")})).filter((function(e){return e.businessObject!==i}));t&&!function(e,t){return e.some((function(e){var n=gr(e);return(n.categoryValueRef&&n.categoryValueRef.$parent)===t}))}(r,t)&&function(e){var t=e.$parent;t&&(bt(t.get("rootElements"),e),e.$parent=null)}(t),e&&!function(e,t){return e.some((function(e){return gr(e).categoryValueRef===t}))}(r,e)&&function(e){var t=e.$parent;t&&(bt(t.get("categoryValue"),e),e.$parent=null)}(e)}function s(e,n){return function(e,t,n){return _t(t.get("categoryValue"),e),e.$parent=t,_t(n.get("rootElements"),t),t.$parent=n,e}(e,n,t.getDefinitions())}function c(n,i){var r=gr(n),o=r.categoryValueRef;o||(o=r.categoryValueRef=i.categoryValue=i.categoryValue||function(e){return e.create("bpmn:CategoryValue")}(e));var a=o.$parent;a||(a=o.$parent=i.category=i.category||function(e){return e.create("bpmn:Category")}(e)),s(o,a,t.getDefinitions())}function p(e,t){var n=t.category,i=t.categoryValue,r=gr(e);i?(r.categoryValueRef=null,a(i,n,r)):a(null,r.categoryValueRef.$parent,r)}function l(t,n){var i=e.create(t.$type);return o.copyElement(t,i,null,n)}r.invoke(Do,this),this.execute("label.create",(function(e){var t=e.context,n=t.labelTarget;vr(n,"bpmn:Group")&&c(n,t)})),this.revert("label.create",(function(e){var t=e.context,n=t.labelTarget;vr(n,"bpmn:Group")&&p(n,t)})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=gr(n);if(vr(n,"bpmn:Group")&&!n.labelTarget){var r=t.categoryValue=i.categoryValueRef;r&&(a(r,t.category=r.$parent,i),i.categoryValueRef=null)}})),this.reverted("shape.delete",(function(e){var t=e.context,n=t.shape;if(vr(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=gr(n);r&&(o.categoryValueRef=r,s(r,i))}})),this.execute("shape.create",(function(e){var t=e.context,n=t.shape;vr(n,"bpmn:Group")&&!n.labelTarget&&gr(n).categoryValueRef&&c(n,t)})),this.reverted("shape.create",(function(e){var t=e.context,n=t.shape;vr(n,"bpmn:Group")&&!n.labelTarget&&gr(n).categoryValueRef&&p(n,t)})),i.on("copyPaste.copyElement",770,(function(e){var t=e.descriptor,n=e.element;if(vr(n,"bpmn:Group")&&!n.labelTarget){var i=gr(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=l(r,!0),r.$parent&&(t.category=l(r.$parent,!0))}}})),i.on("copyPaste.pasteElement",770,(function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=l(i)),r&&(i.$parent=l(r)),delete t.category,delete t.categoryValue}))}function Pu(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Au(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Pu(e,t,n,r),s=Pu(e,t,n,o);i=a&&s?Mu(a,n)>Mu(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",(function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],fn(n.source)),t(i[i.length-1],i[i.length-2],fn(n.target)))}))}function Mu(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Tu(e){Do.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=e.context.shape,i=gr(n),r=br(n);if(yr(i,t)){var o=r.get("isHorizontal");void 0===o&&(o=!0),r.set("isHorizontal",o)}}))}Ru.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],e(Ru,Do),Au.$inject=["eventBus"],Tu.$inject=["eventBus"],e(Tu,Do);var Du=Math.sqrt,Bu=Math.min,Nu=Math.max,ju=Math.abs;function Ou(e){return Math.pow(e,2)}function Lu(e,t){return Du(Ou(e.x-t.x)+Ou(e.y-t.y))}function $u(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=(r*a+o*s)/c,l=p*p-(a*a+s*s-i*i)/c;if(l<0&&l>-1e-6&&(l=0),l<0)return[];var u=Du(l),h=-p+u,d=-p-u,f={x:e.x-r*h,y:e.y-o*h};return 0===l?[f]:[f,{x:e.x-r*d,y:e.y-o*d}].filter((function(n){return function(e,t,n){return Iu(e.x,t.x,n.x)&&Iu(e.y,t.y,n.y)}(n,e,t)}))}function Iu(e,t,n){return e>=Bu(t,n)-Fu&&e<=Nu(t,n)+Fu}var Fu=.1;function zu(e,t){return ju(e.x-t.x)<=Fu&&ju(e.y-t.y)<=Fu}function Hu(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=function(e,t){var n,i,r,o,a,s,c,p,l,u,h,d,f=0;for(f=0;f<t.length-1;f++){if(zu(n=t[f],i=t[f+1])?s=[n]:(r=Lu(e,n),o=Lu(e,i),s=$u(n,i,e,Bu(r,o))),s.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:f,bendpointIndex:zu(n,s[0])?f:f+1}),2===s.length&&(h=s[0],d=s[1],c={type:"segment",position:a={x:(h.x+d.x)/2,y:(h.y+d.y)/2},segmentIndex:f,relativeLocation:Lu(n,a)/Lu(n,i)}),p=Lu(c.position,e),(!u||l>p)&&(u=c,l=p)}return u}(e,n),c=s.segmentIndex,p=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c,p=i.bendpointMove.insert,l=i.bendpointMove.bendpointIndex;return 0===o?r:(r>=l&&(c=p?r+1:r-1),r<l&&(c=r,p&&"bendpoint"!==n.type&&l-1===r&&Vu(t,l)<n.relativeLocation&&c++),c)}return 0===o?r:i.connectionStart&&0===r?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}(n,t,s,i);if(p<0||p>t.length-2||null===p)return a;var l,u,h=Gu(n,c),d=Gu(t,p),f=s.position,m=function(e,t){var n=Ap(e[0],e[1]),i=Ap(e[0],t);return 0===n?0:i/n}(h,f),v=(l=d,u=kp(h),kp(l)-u);if("bendpoint"===s.type){var y=t.length-n.length,g=s.bendpointIndex,b=n[g];if(-1!==t.indexOf(b))return a;if(0===y){var _=t[g];return{delta:{x:r=_.x-s.position.x,y:o=_.y-s.position.y},point:{x:e.x+r,y:e.y+o}}}y<0&&0!==g&&g<n.length-1&&(m=Vu(n,g))}var x,w,E={x:(d[1].x-d[0].x)*m+d[0].x,y:(d[1].y-d[0].y)*m+d[0].y},S=(x={x:e.x-f.x,y:e.y-f.y},(w=v)?{x:Math.cos(w)*x.x-Math.sin(w)*x.y,y:Math.sin(w)*x.x+Math.cos(w)*x.y}:x);return r=E.x+S.x-e.x,o=E.y+S.y-e.y,{point:ln(E),delta:ln({x:r,y:o})}}function Vu(e,t){var n=Ap(e[t-1],e[t]);return n/(n+Ap(e[t],e[t+1]))}function Gu(e,t){return[e[t],e[t+1]]}function Wu(e,t,n){var i=za(t),r=za(n),o=Ha(e,i),a=o.x*(n.width/t.width),s=o.y*(n.height/t.height);return ln({x:r.x+a,y:r.y+s})}function Uu(e,t,n){var i=za(e),r=za(t),o=za(n),a=Ha(e,i),s=Ha(i,r),c=function(e,t,n){var i=un(t),r=un(n);if(function(e,t){return function(e,t){return e.right!==t.right&&e.left!==t.left}(e,t)||function(e,t){return e.top!==t.top&&e.bottom!==t.bottom}(e,t)}(i,r))return null;var o,a,s,c=mn(t,e);if("top"===c)o={x:0,y:r.bottom-i.bottom};else if("bottom"===c)o={x:0,y:r.top-i.top};else if("right"===c)o={x:r.left-i.left,y:0};else{if("left"!==c)return null;o={x:r.right-i.right,y:0}}if(a={x:e.x+o.x,y:e.y+o.y},s=mn(n,a),s!==c)return null;return o}(i,t,n);if(c)return c;var p=s.x*(n.width/t.width),l=s.y*(n.height/t.height),u=o.x+p,h=o.y+l;return ln({x:u+a.x-e.x,y:h+a.y-e.y})}var qu="name",Ku="text";function Yu(e,t,n,i){function r(e){var n=e.context,r=n.element,o=n.properties;if(qu in o&&t.updateLabel(r,o[qu]),Ku in o&&vr(r,"bpmn:TextAnnotation")){var a=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o[Ku]||"");t.updateLabel(r,o.text,a)}}function o(e){var t=e.context,n=t.connection,i=n.label,r=L({},t.hints),o=t.newWaypoints||n.waypoints,a=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Hu(fn(e),t,n,i).delta}(i,o,a,r)}Do.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",(e=>{gr(e.context.element)===e.context.moddleElement&&r(e)})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var i=n.shape||n.connection;!cn(i)&&zr(i)&&Ur(i)&&t.updateLabel(i,Ur(i))}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=o(e),t.moveShape(r,i))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=gr(n);r&&zr(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=e.context,r=i.shape,o=i.newBounds,a=i.oldBounds;if(Hr(r)){var s=r.label,c=function(e,t){if(!t.length)return;var n=function(e,t){var n=t.map((function(t){return{line:t,distance:Pp(e,t)}}));return A(n,"distance")[0].line}(e,t);return Rp(e,n)}(fn(s),[[{x:(n=a).x,y:n.y},{x:n.x+(n.width||0),y:n.y}],[{x:n.x+(n.width||0),y:n.y},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y+(n.height||0)},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y},{x:n.x,y:n.y+(n.height||0)}]]),p=Xu(c,a,o);t.moveShape(s,p)}}))}function Xu(e,t,n){return ln(Ha(Wu(e,t,n),e))}function Zu(e,t){function n(e,t){var n=e.context,i=n.connection,r=L({},n.hints),o=n.newWaypoints||i.waypoints,a=n.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Hu(e,t,n,i).point}(t,o,a,r)}Do.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var i=e.context.connection,r=i.outgoing;i.incoming.forEach((function(i){var r=i.waypoints[i.waypoints.length-1],o=n(e,r),a=[].concat(i.waypoints.slice(0,-1),[o]);t.updateWaypoints(i,a)})),r.forEach((function(i){var r=i.waypoints[0],o=n(e,r),a=[].concat([o],i.waypoints.slice(1));t.updateWaypoints(i,a)}))})),this.postExecute(["connection.move"],(function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,a=n.delta;o.forEach((function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+a.x,y:n.y+a.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)})),r.forEach((function(e){var n=e.waypoints[0],i={x:n.x+a.x,y:n.y+a.y},r=[].concat([i],e.waypoints.slice(1));t.updateWaypoints(e,r)}))}))}function Qu(e,t,n){var i=ih(e),r=rh(i,t),o=i[0];return r.length?r[r.length-1]:Wu(o.original||o,n,t)}function Ju(e,t,n){var i=ih(e),r=rh(i,t),o=i[i.length-1];return r.length?r[0]:Wu(o.original||o,n,t)}function eh(e,t,n){var i=ih(e),r=nh(t,n),o=i[0];return Wu(o.original||o,r,t)}function th(e,t,n){var i=ih(e),r=nh(t,n),o=i[i.length-1];return Wu(o.original||o,r,t)}function nh(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ih(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function rh(e,t){return y(E(e,oh),(function(e){return function(e,t){return"intersect"===mn(t,e,1)}(e,t)}))}function oh(e){return e.original||e}function ah(e,t){Do.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return vr(e,"bpmn:Participant")&&Or(e)&&vr(t,"bpmn:Participant")&&!Or(t)}(n,i)){var r,o,a,s,c=(o=ut([r=n],!1),a=[],s=[],o.forEach((function(e){e!==r&&(e.incoming.forEach((function(e){vr(e,"bpmn:MessageFlow")&&a.push(e)})),e.outgoing.forEach((function(e){vr(e,"bpmn:MessageFlow")&&s.push(e)})))}),[]),{incoming:a,outgoing:s});c.incoming.forEach((function(e){var r=Ju(e,i,n);t.reconnectEnd(e,i,r)})),c.outgoing.forEach((function(e){var r=Qu(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}e(Yu,Do),Yu.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],e(Zu,Do),Zu.$inject=["eventBus","modeling"],ah.$inject=["eventBus","modeling"],e(ah,Do);const sh=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function ch(e){const t=gr(e);if(!(vr(t,"bpmn:BoundaryEvent")||vr(t,"bpmn:StartEvent")&&$r(t.$parent)))return!1;const n=t.get("eventDefinitions");return!(!n||!n.length)&&sh.some((e=>vr(n[0],e)))}function ph(e){return vr(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function lh(e,t){e.invoke(Do,this),this.postExecuted("shape.replace",(function(e){const n=e.context.oldShape,i=e.context.newShape,r=e.context.hints;if(!ch(i))return;const o=ph(i);if(r.targetElement&&void 0!==r.targetElement[o])return;const a=gr(n).get(o);a!==gr(i).get(o)&&t.updateProperties(i,{[o]:a})}))}function uh(e,t){Do.call(this,e),this.preExecute("shape.resize",(function(e){var n=e.shape,i=br(n),r=i&&i.get("label");r&&r.get("bounds")&&t.updateModdleProperties(n,r,{bounds:void 0})}),!0)}function hh(e,t,n){Do.call(this,e),this.preExecute("shape.delete",(function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(vr(r,"bpmn:SequenceFlow")&&vr(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var a=function(e,t){var n=Pu(dh(e[e.length-2]),dh(e[e.length-1]),dh(t[1]),dh(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[dh(e[0]),dh(t[t.length-1])]}(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,a)}}}))}function dh(e){return e.original||e}function fh(e,t){Do.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;vr(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;if(n&&!n.businessObject.participants.length){var i=t.makeProcess(),r=n.children.slice();t.moveElements(r,{x:0,y:0},i)}}),!0)}function mh(e,t,n,i){Do.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&(vr(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),vr(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",(function(e){g(e.closure.allConnections,o)}),!0),this.preExecute("connection.reconnect",(function(e){var i,o,a=e.context,s=a.connection,c=a.newSource||s.source,p=a.newTarget||s.target;(i=n.canConnect(c,p))&&i.type!==s.type&&(o=t.connect(c,p,{type:i.type,associationDirection:i.associationDirection,waypoints:s.waypoints.slice()}),s.parent&&t.removeConnection(s),a.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;if(!o||!o.length)return;if(-1===(n=o.indexOf(e)))return;o.splice(n,1,t)}(s,o))})),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=m(o.outgoing,M({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})}))}function vh(e,t,n,i,r,o){i.invoke(Do,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=_(r,(function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e}),[]);o.length&&this._replaceElements(r,o)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];g(n.closure.topLevel,(function(e){o=$r(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this._replaceElements(o,a.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this._replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}lh.$inject=["injector","modeling"],e(lh,Do),e(uh,Do),uh.$inject=["eventBus","modeling"],e(hh,Do),hh.$inject=["eventBus","bpmnRules","modeling"],fh.$inject=["eventBus","modeling"],e(fh,Do),e(mh,Do),mh.$inject=["eventBus","modeling","bpmnRules","injector"],e(vh,Do),vh.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;g(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},vh.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var yh={width:140,height:120},gh={width:300,height:60},bh={width:60,height:300},_h={width:300,height:150},xh={width:150,height:300},wh={width:140,height:120},Eh={width:50,height:30};function Sh(e){e.on("resize.start",1500,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(vr(n,"bpmn:Lane")||vr(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=mu(e),r=!0,o=!0,a=du(i,[i]),s=un(e),c={},p={},l=Lr(e),u=l?gh:bh;/n/.test(t)?p.top=s.bottom-u.height:/e/.test(t)?p.right=s.left+u.width:/s/.test(t)?p.bottom=s.top+u.height:/w/.test(t)&&(p.left=s.right-u.width);a.forEach((function(e){var i=un(e);l?(i.top<s.top-10&&(r=!1),i.bottom>s.bottom+10&&(o=!1)):(i.left<s.left-10&&(r=!1),i.right>s.right+10&&(o=!1)),/n/.test(t)&&(n&&Ch(s.top-i.bottom)<10&&Mh(c,"top",i.top+u.height),Ch(s.top-i.top)<5&&Ah(p,"top",i.bottom-u.height)),/e/.test(t)&&(n&&Ch(s.right-i.left)<10&&Ah(c,"right",i.right-u.width),Ch(s.right-i.right)<5&&Mh(p,"right",i.left+u.width)),/s/.test(t)&&(n&&Ch(s.bottom-i.top)<10&&Ah(c,"bottom",i.bottom-u.height),Ch(s.bottom-i.bottom)<5&&Mh(p,"bottom",i.top+u.height)),/w/.test(t)&&(n&&Ch(s.left-i.right)<10&&Mh(c,"left",i.left+u.width),Ch(s.left-i.left)<5&&Ah(p,"left",i.right-u.width))}));var h=i.children.filter((function(e){return!e.hidden&&!e.waypoints&&(vr(e,"bpmn:FlowElement")||vr(e,"bpmn:Artifact"))})),d=l?Th:Dh;return h.forEach((function(e){var n=un(e);!/n/.test(t)||l&&!r||Ah(p,"top",n.top-d.top),/e/.test(t)&&(l||o)&&Mh(p,"right",n.right+d.right),!/s/.test(t)||l&&!o||Mh(p,"bottom",n.bottom+d.bottom),/w/.test(t)&&(l||r)&&Ah(p,"left",n.left-d.left)})),{min:p,max:c}}(n,i,r)),vr(n,"bpmn:SubProcess")&&Or(n)&&(t.minDimensions=wh),vr(n,"bpmn:TextAnnotation")&&(t.minDimensions=Eh)}))}Sh.$inject=["eventBus"];var Ch=Math.abs,kh=Math.min,Rh=Math.max;function Ph(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}function Ah(e,t,n){return Ph(e,t,n,kh)}function Mh(e,t,n){return Ph(e,t,n,Rh)}var Th={top:20,left:50,right:20,bottom:20},Dh={top:50,left:20,right:20,bottom:20};function Bh(e,t){e.on("resize.start",1501,(function(e){var t=e.context,n=t.shape;(vr(n,"bpmn:Lane")||vr(n,"bpmn:Participant"))&&(t.balanced=!ca(e))})),e.on("resize.end",1001,(function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(vr(i,"bpmn:Lane")||vr(i,"bpmn:Participant"))return r&&(o=pn(o),t.resizeLane(i,o,n.balanced)),!1}))}Bh.$inject=["eventBus","modeling"];function Nh(e,t,n,i,r){function o(e){return yr(e,["bpmn:ReceiveTask","bpmn:SendTask"])||function(e,t){p(t)||(t=[t]);return w(t,(function(t){return Ir(e,t)}))}(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(t){return!!m(e.getDefinitions().get("rootElements"),M({id:t.id}))}function s(e){return vr(e,"bpmn:ErrorEventDefinition")?"errorRef":vr(e,"bpmn:EscalationEventDefinition")?"escalationRef":vr(e,"bpmn:MessageEventDefinition")?"messageRef":vr(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(e){if(yr(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions")[0];return t.get(s(t))}n.invoke(Do,this),this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],(function(t){var n=t.shape||t.element;if(o(n)){var i=c(gr(n));i&&!a(i)&&(_t(e.getDefinitions().get("rootElements"),i),t.addedRootElement=i)}}),!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],(function(t){var n=t.addedRootElement;n&&bt(e.getDefinitions().get("rootElements"),n)}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element;if(!n.labelTarget&&o(n)){var i=c(gr(n));i&&(t.referencedRootElement=i)}})),t.on("copyPaste.pasteElement",500,(function(e){var t=e.descriptor,n=t.businessObject,o=t.referencedRootElement;o&&(a(o)||(o=i.copyElement(o,r.create(o.$type))),function(e,t){if(yr(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions")[0];n.set(s(n),t)}(n,o),delete t.referencedRootElement)}))}Nh.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],e(Nh,Do);var jh=Math.max;function Oh(e){e.on("spaceTool.getMinDimensions",(function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return g(t,(function(e){var t=e.id;vr(e,"bpmn:Participant")&&(r[t]=function(e,t,n){var i=Lr(e);if(r=e,!fu(r).length)return i?_h:xh;var r;var o=function(e){return"x"===e}(t),a={};a=o?i?_h:{width:$h(e,n,o),height:xh.height}:i?{width:_h.width,height:Lh(e,n,o)}:xh;return a}(e,n,i)),vr(e,"bpmn:Lane")&&(r[t]=Lr(e)?gh:bh),vr(e,"bpmn:SubProcess")&&Or(e)&&(r[t]=wh),vr(e,"bpmn:TextAnnotation")&&(r[t]=Eh),vr(e,"bpmn:Group")&&(r[t]=yh)})),r}))}function Lh(e,t,n){var i;return i=function(e,t,n){var i,r=fu(e);return i=Ih(r,t,n),e.height-i.height+gh.height}(e,t,n),jh(_h.height,i)}function $h(e,t,n){var i;return i=function(e,t,n){var i,r=fu(e);return i=Ih(r,t,n),e.width-i.width+bh.width}(e,t,n),jh(xh.width,i)}function Ih(e,t,n){var i,r,o;for(i=0;i<e.length;i++)if(r=e[i],!n&&t>=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return(o=fu(r)).length?Ih(o,t,n):r}Oh.$inject=["eventBus"];var Fh=180,zh=160;function Hh(e,t,n,i,r,o,a){Do.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(e){return vr(e,"bpmn:SubProcess")&&!Or(e)}function p(t){var n=t.shape,i=t.newRootElement,r=gr(n);i=s._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function l(t){var n=gr(t.shape);s._removeDiagram(n);var i=t.newRootElement=a.get(zo(n));e.removeRootElement(i)}this.executed("shape.create",(function(e){c(e.shape)&&p(e)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.newRootElement;n&&t.children&&(s._showRecursively(t.children),s._moveChildrenToShape(t,n))}),!0),this.reverted("shape.create",(function(e){c(e.shape)&&l(e)}),!0),this.preExecuted("shape.delete",(function(e){var t=e.shape;if(c(t)){var i=a.get(zo(t));i&&n.removeElements(i.children.slice())}}),!0),this.executed("shape.delete",(function(e){c(e.shape)&&l(e)}),!0),this.reverted("shape.delete",(function(e){c(e.shape)&&p(e)}),!0),this.preExecuted("shape.replace",(function(t){var n=t.oldShape,i=t.newShape;c(n)&&c(i)&&(t.oldRoot=e.removeRootElement(zo(n)))}),!0),this.postExecuted("shape.replace",(function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot(zo(i));if(r&&o){var a=r.children;n.moveElements(a,{x:0,y:0},o)}}),!0),this.executed("element.updateProperties",(function(e){var t=e.element;if(vr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(Vo(t))return a.updateId(t,Ho(r)),void a.updateId(i,r);a.get(Ho(i))&&a.updateId(Ho(i),Ho(r))}}}),!0),this.reverted("element.updateProperties",(function(e){var t=e.element;if(vr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(Vo(t))return a.updateId(t,Ho(i)),void a.updateId(r,i);var o=a.get(Ho(r));o&&a.updateId(o,Ho(i))}}}),!0),t.on("element.changed",(function(e){var n=e.element;if(Vo(n)){var i=n,r=a.get(Fo(i));r&&r!==i&&t.fire("element.changed",{element:r})}})),this.executed("shape.toggleCollapse",400,(function(e){var t=e.shape;vr(t,"bpmn:SubProcess")&&(Or(t)?l(e):(p(e),s._showRecursively(t.children)))}),!0),this.reverted("shape.toggleCollapse",400,(function(e){var t=e.shape;vr(t,"bpmn:SubProcess")&&(Or(t)?l(e):(p(e),s._showRecursively(t.children)))}),!0),this.postExecuted("shape.toggleCollapse",600,(function(e){var t=e.shape;if(vr(t,"bpmn:SubProcess")){var n=e.newRootElement;n&&(Or(t)?s._moveChildrenToShape(n,t):s._moveChildrenToShape(t,n))}}),!0),t.on("copyPaste.createTree",(function(e){var t=e.element,n=e.children;if(c(t)){var i=zo(t),r=a.get(i);r&&n.push.apply(n,r.children)}})),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent;if(vr(br(r),"bpmndi:BPMNPlane")){var o=Fo(r),a=m(i,(function(e){return e.id===o}));a&&(t.parent=a.id)}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor;t.parent&&(c(t.parent)||t.parent.hidden)&&(t.hidden=!0)}))}function Vh(e,t){e.invoke(Do,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if(vr(i,"bpmn:SubProcess")&&(vr(n,"bpmn:Task")||vr(n,"bpmn:CallActivity"))&&Or(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}}))}function Gh(e){Do.call(this,e),this.preExecute("connection.create",(function(e){const{target:t}=e;vr(t,"bpmn:TextAnnotation")&&(e.parent=t.parent)}),!0),this.preExecute(["shape.create","shape.resize","elements.move"],(function(e){const t=e.shapes||[e.shape];1===t.length&&vr(t[0],"bpmn:TextAnnotation")&&(e.hints=e.hints||{},e.hints.autoResize=!1)}),!0)}function Wh(e,t){Do.call(this,e),this.postExecuted("shape.toggleCollapse",1500,(function(e){var n=e.shape;if(!Or(n)){var i=ut(n);i.forEach((function(e){var t=e.incoming.slice(),n=e.outgoing.slice();g(t,(function(e){r(e,!0)})),g(n,(function(e){r(e,!1)}))}))}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||(r?t.reconnectEnd(e,n,fn(n)):t.reconnectStart(e,n,fn(n)))}}),!0)}e(Hh,Do),Hh.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling,r=e.children;if(r){var o=(r=r.concat(r.reduce((function(t,n){return n.label&&n.label.parent!==e?t.concat(n.label):t}),[]))).filter((function(e){return!e.hidden}));if(o.length){var a=ht(o);if(t.x){var s=fn(t),c=fn(a);n={x:s.x-c.x,y:s.y-c.y}}else n={x:Fh-a.x,y:zh-a.y};i.moveElements(r,n,t,{autoResize:!1})}else i.moveElements(r,{x:0,y:0},t,{autoResize:!1})}},Hh.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach((function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))})),i},Hh.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},Hh.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});return i.$parent=r,n.createRoot({id:zo(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},Hh.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=m(t,(function(t){return t.plane.bpmnElement.id===e.id}));return t.splice(t.indexOf(n),1),n},Hh.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],Vh.$inject=["injector","modeling"],e(Vh,Do),e(Gh,Do),Gh.$inject=["eventBus"],e(Wh,Do),Wh.$inject=["eventBus","modeling"];function Uh(e,t,n){Do.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t,n=e.context.shape;vr(n,"bpmn:SubProcess")&&(n.collapsed?br(n).isExpanded=!1:((t=n.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),br(n).isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){var t=e.context.shape;t.collapsed?br(t).isExpanded=!1:br(t).isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){var i,r=e.context.shape,o=t.getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r,o=e.children,a=t;return n=(r=o,r.filter((function(e){return!e.hidden}))).concat([e]),(i=pu(n))?(a.width=Math.max(i.width,a.width),a.height=Math.max(i.height,a.height),a.x=i.x+(i.width-a.width)/2,a.y=i.y+(i.height-a.height)/2):(a.x=e.x+(e.width-a.width)/2,a.y=e.y+(e.height-a.height)/2),a}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function qh(e,t,n,i){t.invoke(Do,this),this.preExecute("shape.delete",(function(e){var t=e.context.shape,r=t.businessObject;cn(t)||(vr(t,"bpmn:Participant")&&Or(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))})),this.preExecute("connection.delete",(function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement(),i=t.businessObject;vr(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)}))}function Kh(e,t){Do.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!vr(e,"bpmn:SequenceFlow"))return!1;var n=gr(t),i=gr(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})}))}e(Uh,Do),Uh.$inject=["eventBus","elementFactory","modeling"],e(qh,Do),qh.$inject=["canvas","injector","moddle","modeling"],e(Kh,Do),Kh.$inject=["eventBus","modeling"];function Yh(e,t){var n;function i(){if(!n)throw new Error("out of bounds release");return n}Do.call(this,e);var r=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(r,5e3,(function(e){(n=n||new Xh).enter()})),this.postExecuted(r,500,(function(e){!function(){if(!n)throw new Error("out of bounds release");var e=n.leave();e&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null)}()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context.shape,n=i();t.labelTarget||(vr(t,"bpmn:Lane")&&n.addLane(t),vr(t,"bpmn:FlowNode")&&n.addFlowNode(t))}))}function Xh(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Zh(e,t){Do.call(this,e),this.postExecuted("elements.create",(function(e){const n=e.context.elements;for(const e of n)Qh(e)&&!Jh(e)&&t.updateProperties(e,{isForCompensation:void 0})}))}function Qh(e){const t=gr(e);return t&&t.isForCompensation}function Jh(e){return e.incoming.filter((e=>function(e){return e&&vr(e,"bpmn:BoundaryEvent")&&Ir(e,"bpmn:CompensateEventDefinition")}(e.source))).length>0}Yh.$inject=["eventBus","modeling"],e(Yh,Do),e(Zh,Do),Zh.$inject=["eventBus","modeling"];var ed={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",jl],appendBehavior:["type",Ll],associationBehavior:["type",$l],attachEventBehavior:["type",Il],boundaryEventBehavior:["type",zl],compensateBoundaryEventBehaviour:["type",Hl],createBehavior:["type",Ul],createDataObjectBehavior:["type",ql],createParticipantBehavior:["type",Zl],dataInputAssociationBehavior:["type",Jl],dataStoreBehavior:["type",nu],deleteLaneBehavior:["type",yu],detachEventBehavior:["type",gu],dropOnFlowBehavior:["type",_u],eventBasedGatewayBehavior:["type",Eu],fixHoverBehavior:["type",ku],groupBehavior:["type",Ru],importDockingFix:["type",Au],isHorizontalFix:["type",Tu],labelBehavior:["type",Yu],layoutConnectionBehavior:["type",Zu],messageFlowBehavior:["type",ah],nonInterruptingBehavior:["type",lh],removeElementBehavior:["type",hh],removeEmbeddedLabelBoundsBehavior:["type",uh],removeParticipantBehavior:["type",fh],replaceConnectionBehavior:["type",mh],replaceElementBehaviour:["type",vh],resizeBehavior:["type",Sh],resizeLaneBehavior:["type",Bh],rootElementReferenceBehavior:["type",Nh],spaceToolBehavior:["type",Oh],subProcessPlaneBehavior:["type",Hh],subProcessStartEventBehavior:["type",Vh],textAnnotationBehavior:["type",Gh],toggleCollapseConnectionBehaviour:["type",Wh],toggleElementCollapseBehaviour:["type",Uh],unclaimIdBehavior:["type",qh],unsetDefaultFlowBehavior:["type",Kh],updateFlowNodeRefsBehavior:["type",Yh],setCompensationActivityAfterPasteBehavior:["type",Zh]};function td(e,t){var n=mn(e,t,-15);return"intersect"!==n?n:null}function nd(e){Hc.call(this,e)}function id(e){return!e||cn(e)}function rd(e){do{if(vr(e,"bpmn:Process"))return gr(e);if(vr(e,"bpmn:Participant"))return gr(e).processRef||gr(e)}while(e=e.parent)}function od(e){return vr(e,"bpmn:TextAnnotation")}function ad(e){return vr(e,"bpmn:Group")&&!e.labelTarget}function sd(e){return vr(e,"bpmn:BoundaryEvent")&&ud(e,"bpmn:CompensateEventDefinition")}function cd(e){return gr(e).isForCompensation}function pd(e){for(var t=e;t=t.parent;){if(vr(t,"bpmn:FlowElementsContainer"))return gr(t);if(vr(t,"bpmn:Participant"))return gr(t).processRef}return null}function ld(e,t){return pd(e)===pd(t)}function ud(e,t){return!!m(gr(e).eventDefinitions||[],(function(e){return vr(e,t)}))}function hd(e,t){return(gr(e).eventDefinitions||[]).every((function(e){return vr(e,t)}))}function dd(e,t){var n=function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t);return-1!==n.indexOf(e)}function fd(e,t,n){if(id(e)||id(t))return null;if(!vr(n,"bpmn:DataAssociation")){if(Pd(e,t))return{type:"bpmn:MessageFlow"};if(Ad(e,t))return{type:"bpmn:SequenceFlow"}}var i=Md(e,t);return i||(Rd(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!kd(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function md(e,t){return!(!cn(e)&&!ad(e))||!(vr(t,"bpmn:Participant")&&!Or(t))&&(vr(e,"bpmn:Participant")?vr(t,"bpmn:Process")||vr(t,"bpmn:Collaboration"):yr(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:vr(e,"bpmn:Lane")?vr(t,"bpmn:Participant")||vr(t,"bpmn:Lane"):!(vr(e,"bpmn:BoundaryEvent")&&!function(e){return gr(e).cancelActivity&&(gd(e)||bd(e))}(e))&&(vr(e,"bpmn:FlowElement")&&!vr(e,"bpmn:DataStoreReference")?vr(t,"bpmn:FlowElementsContainer")?Or(t):yr(t,["bpmn:Participant","bpmn:Lane"]):vr(e,"bpmn:DataStoreReference")&&vr(t,"bpmn:Collaboration")?w(gr(t).get("participants"),(function(e){return!!e.get("processRef")})):yr(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?yr(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!vr(e,"bpmn:MessageFlow")&&(vr(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function vd(e){return vr(e,"bpmn:Lane")}function yd(e){return!!function(e){return!cn(e)&&vr(e,"bpmn:BoundaryEvent")}(e)||(!(!vr(e,"bpmn:IntermediateThrowEvent")||!gd(e))||vr(e,"bpmn:IntermediateCatchEvent")&&bd(e))}function gd(e){var t=gr(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function bd(e){return _d(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function _d(e,t){return t.some((function(t){return ud(e,t)}))}function xd(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!cn(r)&&(!!yd(r)&&(!$r(t)&&(!(!vr(t,"bpmn:Activity")||cd(t))&&(!(i&&!td(i,t))&&(!function(e){return vr(e,"bpmn:ReceiveTask")&&m(e.incoming,(function(e){return vr(e.source,"bpmn:EventBasedGateway")}))}(t)&&"attach")))))}function wd(e,t,n){if(!t)return!1;var i={replacements:[]};return g(e,(function(e){$r(t)||vr(e,"bpmn:StartEvent")&&"label"!==e.type&&md(e,t)&&(function(e){return e&&!1!==gr(e).isInterrupting}(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(function(e){return Ir(e,"bpmn:ErrorEventDefinition")}(e)||function(e){return Ir(e,"bpmn:EscalationEventDefinition")}(e)||function(e){return Ir(e,"bpmn:CompensateEventDefinition")}(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),_d(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&vr(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),vr(t,"bpmn:Transaction")||ud(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(vr(e,"bpmn:EndEvent")&&md(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),vr(e,"bpmn:BoundaryEvent")&&xd(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function Ed(e,t){return!w(e,vd)&&(!t||e.every((function(e){return md(e,t)})))}function Sd(e,t,n,i){return!!t&&(!(!cn(e)&&!ad(e))||!function(e,t){return e===t}(n,t)&&((!n||!dd(n,t))&&(md(e,t)||Td(e,t))))}function Cd(e,t){return vr(e,"bpmn:SubProcess")?Or(e)&&(!t||t.width>=100&&t.height>=80):!!vr(e,"bpmn:Lane")||(!!vr(e,"bpmn:Participant")||(!!od(e)||!!ad(e)))}function kd(e,t){return!dd(t,e)&&!dd(e,t)&&(!!function(e,t){var n=od(e),i=od(t);return(n||i)&&n!==i}(e,t)||!!Md(e,t))}function Rd(e,t){return ld(e,t)&&sd(e)&&vr(t,"bpmn:Activity")&&(n=e,!t.attachers.includes(n))&&!$r(t);var n}function Pd(e,t){return!(Bd(e)&&!Bd(t))&&(vr(n=e,"bpmn:InteractionNode")&&!vr(n,"bpmn:BoundaryEvent")&&(!vr(n,"bpmn:Event")||vr(n,"bpmn:ThrowEvent")&&hd(n,"bpmn:MessageEventDefinition"))&&function(e){return vr(e,"bpmn:InteractionNode")&&!cd(e)&&(!vr(e,"bpmn:Event")||vr(e,"bpmn:CatchEvent")&&hd(e,"bpmn:MessageEventDefinition"))&&!(vr(e,"bpmn:BoundaryEvent")&&!ud(e,"bpmn:MessageEventDefinition"))}(t)&&!function(e,t){return rd(e)===rd(t)}(e,t));var n}function Ad(e,t){return vr(n=e,"bpmn:FlowNode")&&!vr(n,"bpmn:EndEvent")&&!$r(n)&&!(vr(n,"bpmn:IntermediateThrowEvent")&&ud(n,"bpmn:LinkEventDefinition"))&&!sd(n)&&!cd(n)&&function(e){return vr(e,"bpmn:FlowNode")&&!vr(e,"bpmn:StartEvent")&&!vr(e,"bpmn:BoundaryEvent")&&!$r(e)&&!(vr(e,"bpmn:IntermediateCatchEvent")&&ud(e,"bpmn:LinkEventDefinition"))&&!cd(e)}(t)&&ld(e,t)&&!(vr(e,"bpmn:EventBasedGateway")&&!function(e){return vr(e,"bpmn:ReceiveTask")||vr(e,"bpmn:IntermediateCatchEvent")&&(ud(e,"bpmn:MessageEventDefinition")||ud(e,"bpmn:TimerEventDefinition")||ud(e,"bpmn:ConditionalEventDefinition")||ud(e,"bpmn:SignalEventDefinition"))}(t));var n}function Md(e,t){return yr(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&yr(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!yr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!yr(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Td(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(yr(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!cn(t)&&vr(e,"bpmn:FlowNode")&&!vr(e,"bpmn:BoundaryEvent")&&md(e,t.parent))}function Dd(e,t){return!!cn(t)||!(vr(t,"bpmn:Lane")&&!function(e,t){return e&&t&&-1!==e.indexOf(t)}(e,t.parent))}function Bd(e){return Jc(e,"bpmn:Process")||Jc(e,"bpmn:Collaboration")}e(nd,Hc),nd.$inject=["eventBus"],nd.prototype.init=function(){this.addRule("connection.start",(function(e){return function(e){if(id(e))return null;return yr(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return fd(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return fd(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return Cd(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(sn(i)&&!Td(t,i))&&x(t,(function(e){return sn(e)?fd(e.source,e.target,e):e.host?xd(e,e.host,null,n):Sd(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return xd(n,t,null,i)||wd(n,t,i)||Ed(n,t)||Td(n,t)})),this.addRule("shape.create",(function(e){return Sd(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return xd(e.shape,e.target,null,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return Dd(e.elements,t)}))},nd.prototype.canConnectMessageFlow=Pd,nd.prototype.canConnectSequenceFlow=Ad,nd.prototype.canConnectDataAssociation=Md,nd.prototype.canConnectAssociation=kd,nd.prototype.canConnectCompensationAssociation=Rd,nd.prototype.canMove=Ed,nd.prototype.canAttach=xd,nd.prototype.canReplace=wd,nd.prototype.canDrop=md,nd.prototype.canInsert=Td,nd.prototype.canCreate=Sd,nd.prototype.canConnect=fd,nd.prototype.canResize=Cd,nd.prototype.canCopy=Dd;var Nd={__depends__:[xp],__init__:["bpmnRules"],bpmnRules:["type",nd]};function jd(e,t){e.on("saveXML.start",2e3,(function(){g(t.getRootElements(),(function(e){var t,n=br(e);t=E(y(ut([e],!1),(function(t){return t!==e&&!t.labelTarget})),br),n.set("planeElement",t)}))}))}jd.$inject=["eventBus","canvas"];var Od={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",jd]};function Ld(e){Do.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function $d(e,t){Ld.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function i(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=m(n,(function(t){return yr(e,[t.type])}));return t&&t.order||{level:1}}(e)),!t)throw new Error(`no order for <${e.id}>`);return t}this.getOrdering=function(e,n){if(e.labelTarget||vr(e,"bpmn:TextAnnotation"))return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var r=i(e);r.containers&&(n=function(e,t,n){for(var i=t;i&&!yr(i,n);)i=i.parent;if(!i)throw new Error(`no parent for <${e.id}> in <${t&&t.id}>`);return i}(e,n,r.containers));var o=n.children.indexOf(e),a=v(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&r.level<i(t).level}));return-1!==a&&-1!==o&&o<a&&(a-=1),{index:a,parent:n}}}Ld.prototype.getOrdering=function(e,t){return null},e(Ld,Do),$d.$inject=["eventBus","canvas"],e($d,Ld);var Id={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",$d]};function Fd(){}Fd.prototype.get=function(){return this._data},Fd.prototype.set=function(e){this._data=e},Fd.prototype.clear=function(){var e=this._data;return delete this._data,e},Fd.prototype.isEmpty=function(){return!this._data};var zd={clipboard:["type",Fd]},Hd="drop-ok",Vd="drop-not-ok",Gd="attach-ok",Wd="new-parent",Ud="create";function qd(e,t,n,i,r){function o(t,n){[Gd,Hd,Vd,Wd].forEach((function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)}))}function a(){var e=t.context();e&&e.prefix===Ud&&t.cancel()}n.on(["create.move","create.hover"],(function(e){var t=e.context,n=t.elements,i=e.hover,a=t.source,s=t.hints||{};if(!i)return t.canExecute=!1,void(t.target=null);Kd(e);var c={x:e.x,y:e.y},p=t.canExecute=i&&function(e,t,n,i,o){if(!t)return!1;var a=m(e=y(e,(function(t){var n=t.labelTarget;return!(t.parent||cn(t)&&-1!==e.indexOf(n))})),(function(e){return!sn(e)})),s=!1,c=!1,p=!1;Yd(e)&&(s=r.allowed("shape.attach",{position:n,shape:a,target:t})),s||(p=Yd(e)?r.allowed("shape.create",{position:n,shape:a,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var l=o.connectionTarget;return p||s?(a&&i&&(c=r.allowed("connection.create",{source:l===i?a:i,target:l===i?i:a,hints:{targetParent:t,targetAttach:s}})),{attach:s,connect:c}):(null===p||null===s)&&null}(n,i,c,a,s);i&&null!==p&&(t.target=i,p&&p.attach?o(i,Gd):o(i,p?Wd:Vd))})),n.on(["create.end","create.out","create.cleanup"],(function(e){var t=e.hover;t&&o(t,null)})),n.on("create.end",(function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,a=t.target,s=t.canExecute,c=s&&s.attach,p=s&&s.connect,l=t.hints||{};if(!1===s||!a)return!1;Kd(e);var u={x:e.x,y:e.y};r=p?i.appendShape(n,r,u,a,{attach:c,connection:!0===p?{}:p,connectionTarget:l.connectionTarget}):m(o=i.createElements(o,u,a,L({},l,{attach:c})),(function(e){return!sn(e)})),L(t,{elements:o,shape:r}),L(e,{elements:o,shape:r})})),n.on("create.init",(function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,(function(){n.off("elements.changed",a)}))})),this.start=function(e,n,i){p(n)||(n=[n]);var r=m(n,(function(e){return!sn(e)}));if(r){i=L({elements:n,hints:{},shape:r},i||{}),g(n,(function(e){u(e.x)||(e.x=0),u(e.y)||(e.y=0)}));var o=ht(y(n,(function(e){return!e.hidden})));g(n,(function(e){sn(e)&&(e.waypoints=E(e.waypoints,(function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}}))),L(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})})),t.init(e,Ud,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function Kd(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function Yd(e){return e&&1===e.length&&!sn(e[0])}qd.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xd(e,t,n,i,r){t.on("create.move",750,(function(t){var o=t.hover,a=t.context,s=a.elements,c=a.dragGroup;c||(c=a.dragGroup=function(e){var t=Ae("g");_e(t,r.cls("djs-drag-group",["no-events"]));var o=Ae("g");return e.forEach((function(e){var r;e.hidden||(e.waypoints?(r=n._createContainer("connection",o),n.drawConnection(Vn(r),e)):(r=n._createContainer("shape",o),n.drawShape(Vn(r),e),Wn(r,e.x,e.y)),i.addDragger(e,t,r))})),t}(s)),o?(c.parentNode||ye(e.getActiveLayer(),c),Wn(c,t.x,t.y)):Fe(c)})),t.on("create.cleanup",(function(e){var t=e.context.dragGroup;t&&Fe(t)}))}Xd.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Zd={__depends__:[vp,Al,xp,_a],__init__:["create","createPreview"],create:["type",qd],createPreview:["type",Xd]};function Qd(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){(t._svg=e.svg).addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}Qd.$inject=["eventBus"],Qd.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null);return n}(0,0)};var Jd={__init__:["mouse"],mouse:["type",Qd]};function ef(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements;t.priority=1,t.id=n.id;var r=m(i,(function(e){return e===n.parent}));r&&(t.parent=n.parent.id),function(e){return!!e.host}(n)&&(t.priority=2,t.host=n.host.id),sn(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=function(e){return E(e.waypoints,(function(e){return(e=tf(e)).original&&(e.original=tf(e.original)),e}))}(n)),cn(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),g(["x","y","width","height"],(function(e){u(n[e])&&(t[e]=n[e])})),t.hidden=n.hidden,t.collapsed=n.collapsed})),r.on("copyPaste.pasteElements",(function(e){L(e.hints,{createElementsBehavior:!1})}))}function tf(e){return L({},e)}function nf(e,t){var n=t.indexOf(e);return-1===n?t:t.splice(n,1)}ef.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],ef.prototype.copy=function(e){var t,n;return p(e)||(e=e?[e]:[]),n=!1===(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(p(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},ef.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},ef.prototype._paste=function(e,t,n,i){g(e,(function(e){u(e.x)||(e.x=0),u(e.y)||(e.y=0)}));var r=ht(e);return g(e,(function(e){sn(e)&&(e.waypoints=E(e.waypoints,(function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}}))),L(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})})),this._modeling.createElements(e,n,t,L({},i))},ef.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return g(e,(function(e,o){g(e=A(e,"priority"),(function(e){var o,a=L({},I(e,["priority"]));return i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),sn(a)?(a.source=i[e.source],a.target=i[e.target],o=i[e.id]=t.createConnection(a),void r.push(o)):cn(a)?(a.labelTarget=i[a.labelTarget],o=i[e.id]=t.createLabel(a),void r.push(o)):(a.host&&(a.host=i[a.host]),o=i[e.id]=t.createShape(a),void r.push(o))}))})),r},ef.prototype.createConnection=function(e){return this._elementFactory.createConnection(I(e,["id"]))},ef.prototype.createLabel=function(e){return this._elementFactory.createLabel(I(e,["id"]))},ef.prototype.createShape=function(e){return this._elementFactory.createShape(I(e,["id"]))},ef.prototype.hasRelations=function(e,t){var n,i;return!(sn(e)&&(n=m(t,M({id:e.source.id})),i=m(t,M({id:e.target.id})),!n||!i))&&!(cn(e)&&!m(t,M({id:e.labelTarget.id})))},ef.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(e,t){var n=m(r,(function(t){return e===t.element}));n?n.depth<t&&(r=function(e,t){var n=t.indexOf(e);-1!==n&&t.splice(n,1);return t}(n,r),r.push({element:n.element,depth:t})):r.push({element:e,depth:t})}return lt(st(e),(function(e,t,i){if(!cn(e)){g(e.labels,(function(e){o(e,i)})),g([e.attachers,e.incoming,e.outgoing],(function(e){e&&e.length&&g(e,(function(e){g(e.labels,(function(e){o(e,i)})),o(e,i)}))})),o(e,i);var r=[];return e.children&&(r=e.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:e,children:r}),r}})),e=E(r,(function(e){return e.element})),r=E(r,(function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e}),t})),r=A(r,(function(e){return e.descriptor.priority})),e=E(r,(function(e){return e.element})),g(r,(function(r){var o=r.depth;n.hasRelations(r.element,e)?!function(e,n){return t.allowed("element.copy",{element:e,elements:n})}(r.element,e)?nf(r.element,e):(i[o]||(i[o]=[]),i[o].push(r.descriptor)):nf(r.element,e)})),i};var rf={__depends__:[zd,Zd,Jd,xp],__init__:["copyPaste"],copyPaste:["type",ef]};function of(e,t,n){p(n)||(n=[n]),g(n,(function(n){a(e[n])||(t[n]=e[n])}))}function af(e,t,n){function i(t,i){var r=e.create(t.$type);return n.copyElement(t,r,null,i)}t.on("copyPaste.copyElement",750,(function(e){var t=e.descriptor,n=e.element,r=gr(n);if(cn(n))return t;var o=t.businessObject=i(r,!0),a=t.di=i(br(n),!0);a.bpmnElement=o,of(o,t,"name"),of(a,t,"isExpanded"),r.default&&(t.default=r.default.id)}));var r="-bpmn-js-refs";t.on("copyPaste.pasteElement",(function(e){var t=e.cache,n=e.descriptor,r=n.businessObject,o=n.di;if(cn(n))return n.businessObject=gr(t[n.labelTarget]),void(n.di=br(t[n.labelTarget]));r=n.businessObject=i(r),(o=n.di=i(o)).bpmnElement=r,of(n,r,["isExpanded","name"]),n.type=r.$type})),t.on("copyPaste.copyElement",750,(function(e){var t=e.descriptor,n=e.element;if(vr(n,"bpmn:Participant")){var r=gr(n);r.processRef&&(t.processRef=i(r.processRef,!0))}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor,n=t.processRef;n&&(t.processRef=i(n))})),t.on("copyPaste.pasteElement",750,(function(e){var t=e.cache;!function(e,t){e[r]=t}(t,function(e,t,n){var i=gr(e);return e.default&&(n[e.default]={element:i,property:"default"}),e.host&&(gr(e).attachedToRef=gr(t[e.host])),I(n,_(n,(function(t,n,r){var o=n.element,a=n.property;return r===e.id&&(o.set(a,i),t.push(e.id)),t}),[]))}(e.descriptor,t,function(e){return e[r]=e[r]||{}}(t)))}))}af.$inject=["bpmnFactory","eventBus","moddleCopy"];var sf=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function cf(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",(function(e){var t=e.propertyNames;if(t&&t.length)return A(t,(function(e){return"extensionElements"===e}))})),e.on("moddleCopy.canCopyProperty",(function(e){var t=e.parent,n=l(t)&&t.$descriptor,i=e.propertyName;return(!i||-1===sf.indexOf(i))&&(!(i&&n&&!m(n.properties,M({name:i})))&&void 0)})),e.on("moddleCopy.canSetCopiedProperty",(function(e){var t,n,i=e.property;if(n="bpmn:ExtensionElements",(t=i)&&h(t.$instanceOf)&&t.$instanceOf(n)&&(!i.values||!i.values.length))return!1}))}function pf(e,t){return _(e.properties,(function(e,n){return t&&n.default?e:e.concat(n.name)}),[])}cf.$inject=["eventBus","bpmnFactory","moddle"],cf.prototype.copyElement=function(e,t,n,i=!1){var r=this;n&&!p(n)&&(n=[n]),n=n||pf(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return!1===o||(p(o)&&(n=o),g(n,(function(n){var o;f(e,n)&&(o=e.get(n));var a=r.copyProperty(o,t,n,i);s(a)&&(!1!==r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:a,propertyName:n})&&t.set(n,a))}))),t},cf.prototype.copyProperty=function(e,t,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(!1!==o){if(o)return l(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference){if(a.isId)return e&&this._copyId(e,t,i);if(p(e))return _(e,(function(e,a){return(o=r.copyProperty(a,t,n,i))?e.concat(o):e}),[]);if(l(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return(o=r._bpmnFactory.create(e.$type)).$parent=t,o=r.copyElement(e,o,null,i)}return e}}},cf.prototype._copyId=function(e,t,n=!1){return n?e:this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};var lf={__depends__:[rf],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",af],moddleCopy:["type",cf]},uf=Math.round;function hf(e,t){this._modeling=e,this._eventBus=t}function df(e,t){t.on("replace.end",500,(function(t){const{newElement:n,hints:i={}}=t;!1!==i.select&&e.select(n)}))}hf.$inject=["modeling","eventBus"],hf.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,p=uf(s+o/2),l=uf(c+a/2),u=i.replaceShape(e,L({},t,{x:p,y:l,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:u,hints:n}),u},df.$inject=["selection","eventBus"];var ff={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",df],replace:["type",hf]};var mf=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function vf(e,t,n,i,r,o){this.replaceElement=function(s,c,l){l=l||{};var u=c.type,h=s.businessObject;if(yf(h)&&("bpmn:SubProcess"===u||"bpmn:AdHocSubProcess"===u)&&function(e,t){var n=e&&f(e,"collapsed")?e.collapsed:!Or(e);return n!==(t&&(f(t,"collapsed")||f(t,"isExpanded"))?f(t,"collapsed")?t.collapsed:!t.isExpanded:n)}(s,c))return i.toggleCollapse(s),s;var d=e.create(u),m={type:u,businessObject:d,di:{}};"bpmn:ExclusiveGateway"===u&&(m.di.isMarkerVisible=!0),function(e,t,n){p(n)||(n=[n]),g(n,(function(n){a(e[n])||(t[n]=e[n])}))}(s.di,m.di,["fill","stroke","background-color","border-color","color"]);var v=function(e,t){return e.filter((function(e){return t.includes(e)}))}(pf(h.$descriptor),pf(d.$descriptor,!0));L(d,$(c,mf));var b=y(v,(function(e){return"eventDefinitions"===e?gf(s,c.eventDefinitionType):"loopCharacteristics"===e?!$r(d):!f(d,e)&&(("processRef"!==e||!1!==c.isExpanded)&&("triggeredByEvent"!==e&&("isForCompensation"!==e||!$r(d))))}));if(d=n.copyElement(h,d,b),c.eventDefinitionType&&(gf(d,c.eventDefinitionType)||(m.eventDefinitionType=c.eventDefinitionType,m.eventDefinitionAttrs=c.eventDefinitionAttrs)),vr(h,"bpmn:Activity")){if(yf(h))m.isExpanded=Or(s);else if(c&&f(c,"isExpanded")){m.isExpanded=c.isExpanded;var _=t.getDefaultSize(d,{isExpanded:m.isExpanded});m.width=_.width,m.height=_.height,m.x=s.x-(m.width-s.width)/2,m.y=s.y-(m.height-s.height)/2}Or(s)&&!vr(h,"bpmn:Task")&&m.isExpanded&&(m.width=s.width,m.height=s.height)}if(yf(h)&&!yf(d)&&(l.moveChildren=!1),vr(h,"bpmn:Participant")){!0===c.isExpanded?d.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var x=Lr(s);br(s).isHorizontal||(br(m).isHorizontal=x),m.width=x?s.width:t.getDefaultSize(m).width,m.height=x?t.getDefaultSize(m).height:s.height}return o.allowed("shape.resize",{shape:d})||(m.height=t.getDefaultSize(m).height,m.width=t.getDefaultSize(m).width),d.name=h.name,yr(h,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&yr(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(d.default=h.default),c.host&&!vr(h,"bpmn:BoundaryEvent")&&vr(d,"bpmn:BoundaryEvent")&&(m.host=c.host),"bpmn:DataStoreReference"!==m.type&&"bpmn:DataObjectReference"!==m.type||(m.x=s.x+(s.width-m.width)/2),r.replaceElement(s,m,{...l,targetElement:c})}}function yf(e){return vr(e,"bpmn:SubProcess")}function gf(e,t){var n=gr(e);return t&&n.get("eventDefinitions").some((function(e){return vr(e,t)}))}vf.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];var bf={__depends__:[lf,ff,_a],bpmnReplace:["type",vf]};function _f(e){this._eventBus=e,this._tools=[],this._active=null}_f.$inject=["eventBus"],_f.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},_f.prototype.isActive=function(e){return e&&this._active===e},_f.prototype.length=function(e){return this._tools.length},_f.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},_f.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",(function(t){t.context.reactivate||!this.isActive(e)?this.setActive(e):this.setActive(null)}),this),g(t,(function(e){i.push(e+".ended"),i.push(e+".canceled")})),n.on(i,250,(function(e){this._active&&(function(e){var t=e.originalEvent&&e.originalEvent.target;return t&&J(t,'.group[data-group="tools"]')}(e)||this.setActive(null))}),this)};var xf={__depends__:[vp],__init__:["toolManager"],toolManager:["type",_f]};function wf(e,t){return-1!==e.indexOf(t)}var Ef=Math.abs,Sf=Math.round,Cf={x:"width",y:"height"},kf="crosshair",Rf={n:"top",w:"left",s:"bottom",e:"right"},Pf={n:"s",w:"e",s:"n",e:"w"};function Af(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",(function(e){n.once("spaceTool.selection.ended",(function(){s.activateMakeSpace(e.originalEvent)}))})),n.on("spaceTool.move",1500,(function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=s.init(e,t)),n&&Tf(e)})),n.on("spaceTool.end",(function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,a=t.resizingShapes,c=t.start;if(t.initialized){Tf(e);var p={x:0,y:0};p[i]=Sf(e["d"+i]),s.makeSpace(o,a,p,r,c),n.once("spaceTool.ended",(function(e){s.activateSelection(e.originalEvent,!0,!0)}))}}))}function Mf(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function Tf(e){var t,n,i=e.context.spaceToolConstraints;i&&(u(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),u(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),u(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),u(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function Df(e,t){return-1!==e.indexOf(t)}Af.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Af.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:kf,data:{context:{reactivate:n}},trapClick:!1})},Af.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:kf,data:{context:{}}})},Af.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Af.prototype.init=function(e,t){var n=Ef(e.dx)>Ef(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(Ef(i)<5)return!1;i<0&&(i*=-1),ca(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),a=this._canvas.getRootElement();!pa(e)&&e.hover&&(a=e.hover);var s=[...ut(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),p=function(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(!a.length)return;var s,c,p={};return g(a,(function(e){var l,h,d,f,m,v,g=e.attachers,b=e.children,_=un(e),x=y(b,(function(e){return!(sn(e)||cn(e)||Df(o,e)||Df(a,e))})),w=y(b,(function(e){return!sn(e)&&!cn(e)&&Df(o,e)})),E=[],S=[];x.length&&(h=Mf(un(ht(x))),l=i-_[Rf[n]]+h[Rf[n]],"n"===n?p.bottom=c=u(c)?Math.min(c,l):l:"w"===n?p.right=c=u(c)?Math.min(c,l):l:"s"===n?p.top=s=u(s)?Math.max(s,l):l:"e"===n&&(p.left=s=u(s)?Math.max(s,l):l)),w.length&&(d=Mf(un(ht(w))),l=i-d[Rf[Pf[n]]]+_[Rf[Pf[n]]],"n"===n?p.bottom=c=u(c)?Math.min(c,l):l:"w"===n?p.right=c=u(c)?Math.min(c,l):l:"s"===n?p.top=s=u(s)?Math.max(s,l):l:"e"===n&&(p.left=s=u(s)?Math.max(s,l):l)),g&&g.length&&(g.forEach((function(e){Df(o,e)?E.push(e):S.push(e)})),E.length&&(f=un(ht(E.map(fn))),m=_[Rf[Pf[n]]]-(f[Rf[Pf[n]]]-i)),S.length&&(v=un(ht(S.map(fn)))[Rf[n]]-(_[Rf[n]]-i)),"n"===n?(l=Math.min(m||1/0,v||1/0),p.bottom=c=u(c)?Math.min(c,l):l):"w"===n?(l=Math.min(m||1/0,v||1/0),p.right=c=u(c)?Math.min(c,l):l):"s"===n?(l=Math.max(m||-1/0,v||-1/0),p.top=s=u(s)?Math.max(s,l):l):"e"===n&&(l=Math.max(m||-1/0,v||-1/0),p.left=s=u(s)?Math.max(s,l):l));var C=r&&r[e.id];C&&("n"===n?(l=i+e[Cf[t]]-C[Cf[t]],p.bottom=c=u(c)?Math.min(c,l):l):"w"===n?(l=i+e[Cf[t]]-C[Cf[t]],p.right=c=u(c)?Math.min(c,l):l):"s"===n?(l=i-e[Cf[t]]+C[Cf[t]],p.top=s=u(s)?Math.max(s,l):l):"e"===n&&(l=i-e[Cf[t]]+C[Cf[t]],p.left=s=u(s)?Math.max(s,l):l))})),p}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return L(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:r}),$a("resize-"+("x"===n?"ew":"ns")),!0},Af.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function p(e){o.includes(e)||o.push(e);var t=e.label;t&&!o.includes(t)&&o.push(t)}g(e,(function(e){if(e.parent&&!cn(e))if(sn(e))c.push(e);else{var o=e[t],l=o+e[Cf[t]];if(function(e){return!!e.host}(e)&&(n>0&&fn(e)[t]>i||n<0&&fn(e)[t]<i))s.push(e);else{var u;if(!(n>0&&o>i||n<0&&l<i))return o<i&&l>i&&r.allowed("shape.resize",{shape:e})?(u=e,void(a.includes(u)||a.push(u))):void 0;p(e)}}})),g(o,(function(e){var t=e.attachers;t&&g(t,(function(e){p(e)}))}));var l=o.concat(a);return g(s,(function(e){var t=e.host;Df(l,t)&&p(e)})),l=o.concat(a),g(c,(function(e){var t=e.source,n=e.target,i=e.label;Df(l,t)&&Df(l,n)&&i&&p(i)})),{movingShapes:o,resizingShapes:a}},Af.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Af.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var Bf="djs-dragging",Nf="djs-resizing",jf=Math.max;function Of(e,t,n,i,r){function o(e,t){g(e,(function(e){r.addDragger(e,t),n.addMarker(e,Bf)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o="M 0,-10000 L 0,10000",a="M -10000,0 L 10000,0",s=Ae("g");_e(s,i.cls("djs-crosshair-group",["no-events"])),ye(t,s);var c=Ae("path");_e(c,"d",o),we(c).add("djs-crosshair"),ye(s,c);var p=Ae("path");_e(p,"d",a),we(p).add("djs-crosshair"),ye(s,p),r.crosshairGroup=s})),e.on("spaceTool.selection.move",(function(e){Wn(e.context.crosshairGroup,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context.crosshairGroup;t&&Fe(t)})),e.on("spaceTool.move",250,(function(e){var a=e.context,s=a.line,c=a.axis,p=a.movingShapes,l=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var u=n.getLayer("space");_e(s=Ae("path"),"d","M0,0 L0,0"),we(s).add("djs-crosshair"),ye(u,s),a.line=s;var h=Ae("g");_e(h,i.cls("djs-drag-group",["no-events"])),ye(n.getActiveLayer(),h),o(p,h),o(a.movingConnections=t.filter((function(e){var t=!1;g(p,(function(n){g(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;g(p,(function(t){g(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;g(l,(function(t){g(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return g(l,(function(t){g(t.incoming,(function(t){e===t&&(r=!0)}))})),sn(e)&&(t||i)&&(n||r)})),h),a.dragGroup=h}if(!a.frameGroup){var d=Ae("g");_e(d,i.cls("djs-frame-group",["no-events"])),ye(n.getActiveLayer(),d);var f=[];g(l,(function(e){var t=r.addFrame(e,d),i=t.getBBox();f.push({element:t,initialBounds:i}),n.addMarker(e,Nf)})),a.frameGroup=d,a.frames=f}_e(s,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[c]});var m={x:e.dx,y:e.dy};m[{x:"y",y:"x"}[a.axis]]=0,Wn(a.dragGroup,m.x,m.y),g(a.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===a.direction?_e(i,{width:jf(r.width+m.x,5)}):_e(i,{width:t=jf(r.width-m.x,5),x:r.x+r.width-t}),"s"===a.direction?_e(i,{height:jf(r.height+m.y,5)}):_e(i,{height:n=jf(r.height-m.y,5),y:r.y+r.height-n})}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;g(i,(function(e){n.removeMarker(e,Bf)})),g(r,(function(e){n.removeMarker(e,Bf)})),s&&(Fe(a),Fe(s)),g(o,(function(e){n.removeMarker(e,Nf)})),c&&Fe(c)}))}Of.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Lf={__init__:["spaceToolPreview"],__depends__:[vp,xp,xf,Al,Jd],spaceTool:["type",Af],spaceToolPreview:["type",Of]};function $f(e,t){e.invoke(Af,this),this._canvas=t}$f.$inject=["injector","canvas"],e($f,Af),$f.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],a=[];o&&(a=C(dt(r.children.filter((e=>vr(e,"bpmn:Artifact"))),ht(o))));const s=[...e,...a];var c=Af.prototype.calculateAdjustments.call(this,s,t,n,i);return c.resizingShapes=c.resizingShapes.filter((function(e){return!vr(e,"bpmn:TextAnnotation")&&(!function(e){return vr(e,"bpmn:Participant")&&!gr(e).processRef}(e)||!("y"===t&&Lr(e)||"x"===t&&!Lr(e)))})),c};var If={__depends__:[Lf],spaceTool:["type",$f]};function Ff(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}Ff.$inject=["eventBus","injector"],Ff.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Ff.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Ff.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Ff.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Ff.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Ff.prototype.register=function(e,t){this._setHandler(e,t)},Ff.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Ff.prototype.canUndo=function(){return!!this._getUndoAction()},Ff.prototype.canRedo=function(){return!!this._getRedoAction()},Ff.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ff.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ff.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo((()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)}))},Ff.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const e of i)if(r=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return r},Ff.prototype._createId=function(){return this._uid++},Ff.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ff.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo((()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)})),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Ff.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Ff.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:R("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ff.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=p(e)?e:[e],t.dirty=t.dirty.concat(e))},Ff.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ff.prototype._revertedAction=function(e){this._stackIdx--},Ff.prototype._getHandler=function(e){return this._handlerMap[e]},Ff.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var zf={commandStack:["type",Ff]};function Hf(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function Vf(e,t,n){Do.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Gf(n),t.validatedShapes=Gf(i)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=t.shapes,r=[];g(n,(function(e){g(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),g(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=e.context.closure,n=t.enclosedElements,i=[];g(n,(function(e){g(e.labels,(function(e){n[e.id]||i.push(e)}))})),t.addAll(i)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context;Hf((t.connection||t.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=xt(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(_t(i.labels,n,r),n.labelTarget=i)}))}function Gf(e){return y(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}e(Vf,Do),Vf.$inject=["injector","eventBus","modeling"];var Wf={__init__:["labelSupport"],labelSupport:["type",Vf]},Uf="attach-ok";function qf(e,t,n,i,r){Do.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=Kf(t=r),P("id",t,n)),i.validatedShapes=function(e){var t=k(e,"id");return y(e,(function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}(o)})),o&&t.on("shape.move.start",251,(function(e){var t=e.context;g(Kf(t.shapes),(function(e){o.makeDraggable(t,e,!0),g(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,Uf),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(r,Uf)})))}})),this.preExecuted("elements.move",1401,(function(e){var t=e.context,n=t.closure;g(Kf(t.shapes),(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||g(i?n:y(n,(function(e){var t,i=e.host;return function(e){return!!e.host}(e)&&(t=i,!(-1!==n.indexOf(t)))})),(function(e){r.updateAttachment(e,i)}))})),this.postExecuted("elements.move",(function(e){g(e.context.shapes,(function(e){g(e.attachers,(function(e){g(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})),g(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;Hf(n.attachers,(function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&g(o.attachers,(function(e){var t=Uu(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers;!1!==(t.hints||{}).attachSupport&&g(a,(function(e){var t=Uu(e,i,o);r.moveShape(e,t,e.parent),g(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;Hf(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function Kf(e){return i(E(e,(function(e){return e.attachers||[]})))}e(qf,Do),qf.$inject=["injector","eventBus","canvas","rules","modeling"];var Yf={__depends__:[xp],__init__:["attachSupport"],attachSupport:["type",qf]};function Xf(e){this._model=e}function Zf(e,t,n){Do.call(this,e),this._bpmnFactory=t;var i=this;function r(e){g(e.context.oldRoot.children,(function(e){vr(e,"bpmn:BaseElement")&&i.updateParent(e)}))}function o(e){var t=e.context.shape;vr(t,"bpmn:BaseElement")&&i.updateBounds(t)}function a(e){i.updateConnection(e.context)}function s(e){i.updateConnectionWaypoints(e.context.connection)}function c(e){i.updateAttachment(e.context)}function p(e){const{element:n}=e.context,i=Ur(n),r=br(n),o=r&&r.get("label");zr(n)||Vo(n)||(i&&!o?r.set("label",t.create("bpmndi:BPMNLabel")):!i&&o&&r.set("label",void 0))}this.executed(["connection.layout","connection.create"],(function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Qf((function(e){var t=e.context;i.updateParent(t.shape||t.connection,t.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Qf((function(e){var t=e.context,n=t.shape||t.connection,r=t.parent||t.newParent;i.updateParent(n,r)}))),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],Qf((function(e){"label"!==e.context.shape.type&&o(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],Qf((function(e){"label"!==e.context.shape.type&&o(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&o({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Qf(a)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Qf(a)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Qf(s)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Qf(s)),this.executed("connection.reconnect",Qf((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=gr(n),a=gr(i),s=gr(r);o.conditionExpression&&!yr(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",Qf((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=gr(n),a=gr(i),s=gr(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],Qf(c)),this.reverted(["element.updateAttachment"],Qf(c)),this.executed("element.updateLabel",Qf(p)),this.reverted("element.updateLabel",Qf(p))}function Qf(e){return function(t){var n=t.context;vr(n.shape||n.connection||n.element,"bpmn:BaseElement")&&e(t)}}function Jf(e,t){$n.call(this),this._bpmnFactory=e,this._moddle=t}function em(e,t,n){return void 0===t[n]?t:(e[n]=t[n],I(t,[n]))}function tm(e,t){this._modeling=e,this._canvas=t}function nm(e){this._modeling=e}function im(e,t){this._canvas=e,this._layouter=t}Xf.$inject=["moddle"],Xf.prototype._needsId=function(e){return yr(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Xf.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=vr(e,"bpmn:Activity")?"Activity":vr(e,"bpmn:Event")?"Event":vr(e,"bpmn:Gateway")?"Gateway":yr(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},Xf.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Xf.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Xf.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",L({bpmnElement:e,bounds:this.createDiBounds()},t))},Xf.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Xf.prototype.createDiWaypoints=function(e){var t=this;return E(e,(function(e){return t.createDiWaypoint(e)}))},Xf.prototype.createDiWaypoint=function(e){return this.create("dc:Point",$(e,["x","y"]))},Xf.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",L({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Xf.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",L({bpmnElement:e},t))},e(Zf,Do),Zf.$inject=["eventBus","bpmnFactory","connectionDocking"],Zf.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Zf.prototype.updateParent=function(e,t){if(!(cn(e)||vr(e,"bpmn:DataStoreReference")&&e.parent&&vr(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=br(e),o=n&&n.businessObject,a=br(n);vr(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),vr(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),vr(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),vr(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Zf.prototype.updateBounds=function(e){var t=br(e),n=function(e){if(!vr(e,"bpmn:Activity"))return;var t=br(e);if(!t)return;var n=t.get("label");if(!n)return;return n.get("bounds")}(e);if(n){var i=Ha(n,t.get("bounds"));L(n,{x:e.x+i.x,y:e.y+i.y})}var r=cn(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),L(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Zf.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(vr(n,"bpmn:Lane")&&bt(n.get("flowNodeRef"),e),vr(t,"bpmn:Lane")&&_t(t.get("flowNodeRef"),e))},Zf.prototype.updateDiConnection=function(e,t,n){var i=br(e),r=br(t),o=br(n);i.sourceElement&&i.sourceElement.bpmnElement!==gr(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==gr(n)&&(i.targetElement=n&&o)},Zf.prototype.updateDiParent=function(e,t){if(t&&!vr(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(bt(n,e),e.$parent=null)}},Zf.prototype.getLaneSet=function(e){var t,n;return vr(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(vr(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Zf.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&(!vr(e,"bpmn:DataInput")&&!vr(e,"bpmn:DataOutput")||(vr(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(vr(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(vr(e,"bpmn:FlowElement")){if(t)if(vr(t,"bpmn:Participant"))t=t.processRef;else if(vr(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(vr(t,"bpmn:Lane"));i="flowElements"}else if(vr(e,"bpmn:Artifact")){for(;t&&!vr(t,"bpmn:Process")&&!vr(t,"bpmn:SubProcess")&&!vr(t,"bpmn:Collaboration");){if(vr(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(vr(e,"bpmn:MessageFlow"))i="messageFlows";else if(vr(e,"bpmn:Participant")){i="participants";var r,o=e.processRef;o&&(r=function(e){for(;e&&!vr(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(bt(r.get("rootElements"),o),o.$parent=null),t&&(_t(r.get("rootElements"),o),o.$parent=r))}else vr(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":vr(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&bt(a=e.$parent.get(i),e),t?((a=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var s=n.get(i);bt(a,e),t&&(s||(s=[],t.set(i,s)),s.push(e))}}},Zf.prototype.updateConnectionWaypoints=function(e){br(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Zf.prototype.updateConnection=function(e){var t,n=e.connection,i=gr(n),r=n.source,o=gr(r),a=n.target,s=gr(n.target);if(vr(i,"bpmn:DataAssociation"))vr(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):vr(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=vr(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&(bt(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&(bt(i.targetRef&&i.targetRef.get("incoming"),i),s&&s.get("incoming")&&s.get("incoming").push(i)),i.targetRef=s)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,a)},Zf.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},e(Jf,$n),Jf.$inject=["bpmnFactory","moddle"],Jf.prototype._baseCreate=$n.prototype.create,Jf.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,L({type:"label",di:n},Fr,t))}return this.createElement(e,t)},Jf.prototype.createElement=function(e,t){var n,i,r,o=(t=L({},t||{})).businessObject,a=t.di;if(!o){if(!t.type)throw new Error("no shape type specified");dr(o=this._bpmnFactory.create(t.type))}if(!yr(a,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var c=L({},a||{},{id:o.id+"_di"});a="root"===e?this._bpmnFactory.createDiPlane(o,c):"connection"===e?this._bpmnFactory.createDiEdge(o,c):this._bpmnFactory.createDiShape(o,c)}return vr(o,"bpmn:Group")&&(t=L({isFrame:!0},t)),t=function(e,t,n){return g(n,(function(n){t=em(e,t,n)})),t}(o,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=em(a,t,"isExpanded")),yr(o,["bpmn:Lane","bpmn:Participant"])&&(t=em(a,t,"isHorizontal")),vr(o,"bpmn:SubProcess")&&(t.collapsed=!Or(o,a)),vr(o,"bpmn:ExclusiveGateway")&&(f(a,"isMarkerVisible")?void 0===a.isMarkerVisible&&(a.isMarkerVisible=!1):a.isMarkerVisible=!0),s(t.triggeredByEvent)&&(o.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),s(t.cancelActivity)&&(o.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(i=o.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=o,o.eventDefinitions=i,delete t.eventDefinitionType),n=this.getDefaultSize(o,a),t=L({id:o.id},n,t,{businessObject:o,di:a}),this._baseCreate(e,t)},Jf.prototype.getDefaultSize=function(e,t){var n=gr(e);if(t=t||br(e),vr(n,"bpmn:SubProcess"))return Or(n,t)?{width:350,height:200}:{width:100,height:80};if(vr(n,"bpmn:Task"))return{width:100,height:80};if(vr(n,"bpmn:Gateway"))return{width:50,height:50};if(vr(n,"bpmn:Event"))return{width:36,height:36};if(vr(n,"bpmn:Participant")){var i=void 0===t.isHorizontal||!0===t.isHorizontal;return Or(n,t)?i?{width:600,height:250}:{width:250,height:600}:i?{width:400,height:60}:{width:60,height:400}}return vr(n,"bpmn:Lane")?{width:400,height:100}:vr(n,"bpmn:DataObjectReference")?{width:36,height:50}:vr(n,"bpmn:DataStoreReference")?{width:50,height:50}:vr(n,"bpmn:TextAnnotation")?{width:100,height:30}:vr(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Jf.prototype.createParticipantShape=function(e){return l(e)||(e={isExpanded:e}),!1!==(e=L({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},tm.$inject=["modeling","canvas"],tm.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;g(n,(function(e){var n={x:0,y:0};s(i.left)?n.x=i.left-e.x:s(i.right)?n.x=i.right-e.width-e.x:s(i.center)?n.x=i.center-Math.round(e.width/2)-e.x:s(i.top)?n.y=i.top-e.y:s(i.bottom)?n.y=i.bottom-e.height-e.y:s(i.middle)&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},tm.prototype.postExecute=function(e){},nm.$inject=["modeling"],nm.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},nm.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,w(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},im.$inject=["canvas","layouter"],im.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},im.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var rm=Math.round;function om(e){this._modeling=e}om.$inject=["modeling"],om.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;g(t,(function(e){u(e.x)||(e.x=0),u(e.y)||(e.y=0)}));var s=ht(y(t,(function(e){return!e.hidden})));g(t,(function(e){sn(e)&&(e.waypoints=E(e.waypoints,(function(e){return{x:rm(e.x-s.x-s.width/2+r.x),y:rm(e.y-s.y-s.height/2+r.y)}}))),L(e,{x:rm(e.x-s.x-s.width/2+r.x),y:rm(e.y-s.y-s.height/2+r.y)})}));var c=st(t),p={};g(t,(function(e){if(sn(e))p[e.id]=u(i)?a.createConnection(p[e.source.id],p[e.target.id],i,e,e.parent||n,o):a.createConnection(p[e.source.id],p[e.target.id],e,e.parent||n,o);else{var t=L({},o);-1===c.indexOf(e)&&(t.autoResize=!1),cn(e)&&(t=I(t,["attach"])),p[e.id]=u(i)?a.createShape(e,$(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,$(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=C(p)};var am=Math.round;function sm(e){this._canvas=e}function cm(e){sm.call(this,e)}sm.$inject=["canvas"],sm.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?L(t,n):L(t,{x:n.x-am(t.width/2),y:n.y-am(t.height/2)}),this._canvas.addShape(t,i,r),t},sm.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},e(cm,sm),cm.$inject=["canvas"];var pm=sm.prototype.execute;cm.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,pm.call(this,e)};var lm=sm.prototype.revert;function um(e,t){this._canvas=e,this._modeling=t}function hm(e,t){this._modeling=e,this._elementRegistry=t}function dm(e,t){this._canvas=e,this._modeling=t}function fm(e){this._modeling=e}cm.prototype.revert=function(e){return e.shape.labelTarget=null,lm.call(this,e)},um.$inject=["canvas","modeling"],um.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Hf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Hf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})}))},um.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=xt(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},um.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,_t(n.children,t,i),this._canvas.addConnection(t,n),t},hm.$inject=["modeling","elementRegistry"],hm.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;g(e.elements,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},dm.$inject=["canvas","modeling"],dm.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Hf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Hf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),Hf(n.children,(function(e){sn(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},dm.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=xt(i.children,n),t.removeShape(n),n},dm.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return _t(i.children,n,r),t.addShape(n,i),n},fm.$inject=["modeling"];var mm={x:"y",y:"x"};function vm(e,t){this._layouter=e,this._canvas=t}function ym(){}function gm(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function bm(e){this._modeling=e}function _m(e){this._helper=new bm(e)}function xm(e){this._modeling=e,this._helper=new bm(e)}function wm(e){this._modeling=e}function Em(e){return e.original||e}function Sm(e,t){this._modeling=e,this._rules=t}function Cm(e){this._modeling=e}function km(e){this._modeling=e}function Rm(e){return L({},e)}function Pm(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Am(e,t,n){var i=Pm(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Mm(e,t){return-1!==e.indexOf(t)}function Tm(e){this._modeling=e}function Dm(e){var t={};return g(e,(function(e){t[e.id]=e.hidden,e.children&&(t=L({},t,Dm(e.children)))})),t}function Bm(e,t){var n=[];return g(e,(function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(Bm(e.children,e.collapsed||t)))})),n}function Nm(e,t){var n=[];return g(e,(function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(Nm(e.children,t)))})),n}function jm(e){this._modeling=e}function Om(e,t){return bt(e&&e.attachers,t)}function Lm(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),_t(i,t,n)}}function $m(){}function Im(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function Fm(e){this._elementRegistry=e}function zm(e,t){g(t,(function(t,n){e.set(n,t)}))}fm.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function a(e){return e[i]+e[r]/2}function s(e){return e.length-1}function c(e){return e.max-e.min}var p,l,u=n[0],h=s(n),d=n[h],f=0;g(n,(function(e,p){var l,u,d;e.elements.length<2?p&&p!==n.length-1&&(o(e,e.elements[0]),f+=c(e.range)):(u=(l=A(e.elements,i))[0],p===h&&(u=l[s(l)]),d=a(u),e.range=null,g(l,(function(n){!function(e,n){var r={y:0};r[i]=e-a(n),r[i]&&(r[mm[i]]=0,t.moveElements([n],r,n.parent))}(d,n),null!==e.range?o(e,n):e.range={min:n[i],max:n[i]+n[r]}})),p&&p!==n.length-1&&(f+=c(e.range)))})),l=Math.abs(d.range.min-u.range.max),(p=Math.round((l-f)/(n.length-1)))<n.length-1||g(n,(function(e,o){var a,s={};e!==u&&e!==d&&(a=n[o-1],e.range.max=0,g(e.elements,(function(n,o){s[mm[i]]=0,s[i]=a.range.max-n[i]+p,e.range.min!==n[i]&&(s[i]+=n[i]-e.range.min),s[i]&&t.moveElements([n],s,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)})))}))},fm.prototype.postExecute=function(e){},vm.$inject=["layouter","canvas"],vm.prototype.execute=function(e){var t=e.connection;return L(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},vm.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},ym.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=bt(o.children,t),_t(i.children,t,r),t.parent=i,g(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},ym.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return bt(n.children,t),_t(i.children,t,r),t.parent=i,g(t.waypoints,(function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)})),t},gm.prototype.add=function(e,t){return this.addAll([e],t)},gm.prototype.addAll=function(e,t){var n=function(e,t,n){a(t)&&(t=!0),l(t)&&(n=t,t=!0);var i=vt((n=n||{}).allShapes),r=vt(n.allConnections),o=vt(n.enclosedElements),s=vt(n.enclosedConnections),c=vt(n.topLevel,t&&k(e,(function(e){return e.id})));function p(e){c[e.source.id]&&c[e.target.id]&&(c[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(s[e.id]=o[e.id]=e),r[e.id]=e}return lt(e,(function(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,g(e.incoming,p),g(e.outgoing,p),e.children;s[e.id]=r[e.id]=e})),{allShapes:i,allConnections:r,topLevel:c,enclosedConnections:s,enclosedElements:o}}(e,!!t,this);return L(this,n),this},bm.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},bm.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,p=e.topLevel,l=!1;r&&r.parent===n&&(l=!0),g(a,(function(e){o.moveShape(e,t,p[e.id]&&!l&&n,{recurse:!1,layout:!1})})),g(s,(function(e){var i=!!a[e.source.id],r=!!a[e.target.id];c[e.id]&&i&&r?o.moveConnection(e,t,p[e.id]&&!l&&n):o.layoutConnection(e,{connectionStart:i&&eh(e,e.source,t),connectionEnd:r&&th(e,e.target,t)})}))},bm.prototype.getClosure=function(e){return(new gm).addAll(e,!0)},_m.$inject=["modeling"],_m.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},_m.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},xm.$inject=["modeling"],xm.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=$(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=bt(o.children,t),_t(i.children,t,r),L(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},xm.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(g(t.incoming,(function(e){r.layoutConnection(e,{connectionEnd:th(e,t,n)})})),g(t.outgoing,(function(e){r.layoutConnection(e,{connectionStart:eh(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},xm.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return _t(n.children,t,i),L(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},xm.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},xm.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},wm.$inject=["modeling"],wm.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return p(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},wm.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(!n||i&&"source"!==o.docking||(a.connectionStart=a.connectionStart||Em(p(r)?r[0]:r)),!i||n&&"target"!==o.docking||(a.connectionEnd=a.connectionEnd||Em(p(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},wm.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},Sm.$inject=["modeling","rules"],Sm.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,s=e.hints||{};function c(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var p,l={x:a.x,y:a.y},u={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,l,o.parent,s),o.host&&i.updateAttachment(t,o.host),!1!==s.moveChildren&&(p=o.children.slice(),i.moveElements(p,{x:0,y:0},t,s));var h=o.incoming.slice(),d=o.outgoing.slice();g(h,(function(e){c(e.source,t,e)&&n.reconnectEnd(e,t,Ju(e,t,u),s)})),g(d,(function(e){var i=e.target;c(t,i,e)&&n.reconnectStart(e,t,Qu(e,t,u),s)}))},Sm.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Sm.prototype.execute=function(e){},Sm.prototype.revert=function(e){},Sm.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Sm.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Sm.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},Cm.$inject=["modeling"],Cm.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},L(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Cm.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(g(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:Ju(e,n,i)})})),g(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:Qu(e,n,i)})})))},Cm.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return L(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},km.$inject=["modeling"],km.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),g(r,(function(e){a[e.id]=function(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}(e)})),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(e,t){var n=[];return g(e.concat(t),(function(i){var r=i.incoming,o=i.outgoing;g(r.concat(o),(function(i){var r=i.source,o=i.target;(wf(e,r)||wf(e,o)||wf(t,r)||wf(t,o))&&(wf(n,i)||n.push(i))}))})),n}(i,r),t,n,o,i,r,a)},km.prototype.execute=function(){},km.prototype.revert=function(){},km.prototype.moveShapes=function(e,t){var n=this;g(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},km.prototype.resizeShapes=function(e,t,n){var i=this;g(e,(function(e){var r=function(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},km.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);g(e,(function(e){var p=e.source,l=e.target,u=function(e){return E(e.waypoints,(function(e){return(e=Rm(e)).original&&(e.original=Rm(e.original)),e}))}(e),h=Pm(n),d={};Mm(c,p)&&Mm(c,l)?(u=E(u,(function(e){return Am(e,i,n)&&(e[h]=e[h]+t[h]),e.original&&Am(e.original,i,n)&&(e.original[h]=e.original[h]+t[h]),e})),s._modeling.updateWaypoints(e,u,{labelBehavior:!1})):(Mm(c,p)||Mm(c,l))&&(Mm(r,p)?d.connectionStart=eh(e,p,t):Mm(r,l)?d.connectionEnd=th(e,l,t):Mm(o,p)?d.connectionStart=Qu(e,p,a[p.id]):Mm(o,l)&&(d.connectionEnd=Ju(e,l,a[l.id])),s._modeling.layoutConnection(e,d))}))},Tm.$inject=["modeling"],Tm.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Dm(n),t.collapsed=!t.collapsed;var i=Bm(n,t.collapsed);return[t].concat(i)},Tm.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=Nm(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},jm.$inject=["modeling"],jm.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Om(i,t),Lm(n,t),t.host=n,t},jm.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Om(n,t),Lm(i,t,r),t},$m.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},$m.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Im.$inject=["eventBus","elementFactory","commandStack"],Im.prototype.getHandlers=function(){return{"shape.append":nm,"shape.create":sm,"shape.delete":dm,"shape.move":xm,"shape.resize":Cm,"shape.replace":Sm,"shape.toggleCollapse":Tm,spaceTool:km,"label.create":cm,"connection.create":im,"connection.delete":um,"connection.move":ym,"connection.layout":vm,"connection.updateWaypoints":$m,"connection.reconnect":wm,"elements.create":om,"elements.move":_m,"elements.delete":hm,"elements.distribute":fm,"elements.align":tm,"element.updateAttachment":jm}},Im.prototype.registerHandlers=function(e){g(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},Im.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Im.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Im.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;!0===o?(r=n,a=n.parent):!1===o&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},Im.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Im.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Im.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},Im.prototype.createShape=function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=void 0);var o,a,s=(r=r||{}).attach;e=this._create("shape",e),s?(o=n.parent,a=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Im.prototype.createElements=function(e,t,n,i,r){p(e)||(e=[e]),"number"!=typeof i&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},Im.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Im.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Im.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Im.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Im.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Im.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Im.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Im.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Im.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Im.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Im.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Im.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Im.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,L(i,{docking:"source"}))},Im.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,L(i,{docking:"target"}))},Im.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Im.prototype._create=function(e,t){return t instanceof Dn?t:this._elementFactory.create(e,t)},Im.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},Fm.$inject=["elementRegistry"],Fm.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||function(e,t){return _(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,S(i));return zm(n,i),e.oldProperties=o,e.changed=r,r},Fm.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return zm(n,t),i},Fm.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return vr(e,"bpmn:DataObject")?function(e,t){return t.filter((function(t){return vr(t,"bpmn:DataObjectReference")&&gr(t).dataObjectRef===e}))}(e,t):[]};var Hm="default",Vm="id",Gm="di",Wm={width:0,height:0};function Um(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}function qm(e,t){return Vm in e&&e[Vm]!==t[Vm]}function Km(e,t){var n=e.businessObject,i=br(e);g(t,(function(e,t){t!==Gm?n.set(t,e):i&&function(e,t){g(t,(function(t,n){e.set(n,t)}))}(i,e)}))}Um.$inject=["elementRegistry","moddle","modeling","textRenderer"],Um.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var i=this._elementRegistry,r=this._moddle.ids,o=t.businessObject,a=function(e){var t=L({},e);return Ym.forEach((function(n){n in e&&(t[n]=gr(t[n]))})),t}(e.properties),s=e.oldProperties||function(e,t){var n=S(t),i=e.businessObject,r=br(e);return _(n,(function(e,n){return e[n]=n!==Gm?i.get(n):function(e,t){return _(t,(function(t,n){return t[n]=e&&e.get(n),t}),{})}(r,S(t.di)),e}),{})}(t,a);return qm(a,o)&&(r.unclaim(o[Vm]),i.updateId(t,a[Vm]),r.claim(a[Vm],o)),Hm in a&&(a[Hm]&&n.push(i.get(a[Hm].id)),o[Hm]&&n.push(i.get(o[Hm].id))),Km(t,a),e.oldProperties=s,e.changed=n,n},Um.prototype.postExecute=function(e){var t=e.element.label,n=t&&gr(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,Wm)}},Um.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Km(t,i),qm(n,r)&&(a.unclaim(n[Vm]),o.updateId(t,i[Vm]),a.claim(i[Vm],r)),e.changed};var Ym=["default"];function Xm(e,t){this._canvas=e,this._modeling=t}function Zm(e,t){this._modeling=e,this._spaceTool=t}function Qm(e){this._modeling=e}function Jm(e,t){this._modeling=e,this._spaceTool=t}Xm.$inject=["canvas","modeling"],Xm.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=br(r);return t.setRootElement(n),t.removeRootElement(r),_t(a.rootElements,i),i.$parent=a,bt(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Xm.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=br(n);return t.setRootElement(r),t.removeRootElement(n),bt(a.rootElements,i),i.$parent=null,_t(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]},Zm.$inject=["modeling","spaceTool"],Zm.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=mu(i),a=o===i,s=a?i:i.parent,c=fu(s),p=Lr(i);if(p?"left"===r?r="top":"right"===r&&(r="bottom"):"top"===r?r="left":"bottom"===r&&(r="right"),!c.length){var l=p?{x:i.x+hu,y:i.y,width:i.width-hu,height:i.height}:{x:i.x,y:i.y+hu,width:i.width,height:i.height-hu};n.createShape({type:"bpmn:Lane",isHorizontal:p},l,s)}var u,h,d,f,m,v=[];lt(o,(function(e){return v.push(e),e.label&&v.push(e.label),e===i?[]:y(e.children,(function(e){return e!==i}))})),"top"===r?(u=-120,d=(h=i.y)+10,f="n",m="y"):"left"===r?(u=-120,d=(h=i.x)+10,f="w",m="x"):"bottom"===r?(u=120,d=(h=i.y+i.height)-10,f="s",m="y"):"right"===r&&(u=120,d=(h=i.x+i.width)-10,f="e",m="x");var g=t.calculateAdjustments(v,m,u,d),b=p?{x:0,y:u}:{x:u,y:0};t.makeSpace(g.movingShapes,g.resizingShapes,b,f,d);var _=p?{x:i.x+(a?hu:0),y:h-("top"===r?120:0),width:i.width-(a?hu:0),height:120}:{x:h-("left"===r?120:0),y:i.y+(a?hu:0),width:120,height:i.height-(a?hu:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:p},_,s)},Qm.$inject=["modeling"],Qm.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=fu(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var a,s,c,p,l=Lr(n),u=l?n.height:n.width,h=Math.round(u/i);for(p=0;p<i;p++)a=p===i-1?u-h*p:h,s=l?{x:n.x+hu,y:n.y+p*h,width:n.width-hu,height:a}:{x:n.x+p*h,y:n.y+hu,width:a,height:n.height-hu},p<o?t.resizeShape(r[p],s):(c={type:"bpmn:Lane",isHorizontal:l},t.createShape(c,s,n))},Jm.$inject=["modeling","spaceTool"],Jm.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},Jm.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=vu(e,t);n.resizeShape(e,t),i.forEach((function(e){n.resizeShape(e.shape,e.newBounds)}))},Jm.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=un(e),p=ou(un(t),c),l=mu(e),u=[],h=[];lt(l,(function(e){return u.push(e),(vr(e,"bpmn:Lane")||vr(e,"bpmn:Participant"))&&h.push(e),e.children})),(p.bottom||p.top)&&(n=p.bottom||p.top,i=e.y+(p.bottom?e.height:0)+(p.bottom?-10:10),r=p.bottom?"s":"n",o=p.top>0||p.bottom<0?-n:n,a=s.calculateAdjustments(u,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(p.left||p.right)&&(n=p.right||p.left,i=e.x+(p.right?e.width:0)+(p.right?-10:100),r=p.right?"e":"w",o=p.left>0||p.right<0?-n:n,a=s.calculateAdjustments(h,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var ev="flowNodeRef",tv="lanes";function nv(e){this._elementRegistry=e}function iv(e){this._moddle=e}nv.$inject=["elementRegistry"],nv.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}function s(e){if(!e.parent)return[];var t=function(e){var t=mu(e);return r[t.id]||(r[t.id]=du(t)),r[t.id]}(e);return t.filter((function(t){return n=e,i=un(t),r=n.x+n.width/2,o=n.y+n.height/2,r>i.left&&r<i.right&&o>i.top&&o<i.bottom;var n,i,r,o})).map((function(e){return e.businessObject}))}return t.forEach((function(e){var t=mu(e);if(t&&-1===n.indexOf(t)){var i=t.children.filter((function(e){return vr(e,"bpmn:FlowNode")}));i.forEach(a),n.push(t)}})),e.forEach(a),o.forEach((function(e){var t=e.businessObject,n=t.get(tv).slice(),r=s(e);i.push({flowNode:t,remove:n,add:r})})),t.forEach((function(e){var t=e.businessObject;e.parent||t.get(ev).forEach((function(e){i.push({flowNode:e,remove:[t],add:[]})}))})),i},nv.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach((function(e){var t=e.flowNode,n=t.get(tv);e.remove.forEach((function(e){bt(n,e),bt(e.get(ev),t)})),e.add.forEach((function(e){_t(n,e),_t(e.get(ev),t)}))})),[]},nv.prototype.revert=function(e){return e.updates.forEach((function(e){var t=e.flowNode,n=t.get(tv);e.add.forEach((function(e){bt(n,e),bt(e.get(ev),t)})),e.remove.forEach((function(e){_t(n,e),_t(e.get(ev),t)}))})),[]},iv.$inject=["moddle"],iv.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.claim(n,i):t.unclaim(n),[]},iv.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.unclaim(n):t.claim(n,i),[]};var rv={fill:void 0,stroke:void 0};function ov(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(d(e)){var t=function(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}(e);if(t)return t}throw new Error(`invalid color value: ${e}`)}}}ov.$inject=["commandStack"],ov.prototype.postExecute=function(e){var t=e.elements,n=e.colors||rv,i=this,r={};"fill"in n&&L(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&L(r,{"border-color":this._normalizeColor(n.stroke)}),g(t,(function(e){var t=sn(e)?$(r,["border-color"]):r,n=br(e);if(function(e){"border-color"in e&&(e.stroke=e["border-color"]);"background-color"in e&&(e.fill=e["background-color"])}(t),cn(e))i._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:n.label,properties:{color:r["border-color"]}});else{if(!yr(n,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}}))};var av={width:0,height:0};function sv(e,t,n){function i(e,t){var n=e.label||e,i=e.labelTarget||e;return function(e,t){var n=e.businessObject,i=Wr(n);if(i)if("categoryValueRef"===i){if(!n[i])return e;n[i].value=t}else n[i]=t}(n,t),[n,i]}this.preExecute=function(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!cn(n)&&zr(n)&&!Hr(n)&&!cv(r)){var o=Gr(n);o={x:o.x,y:o.y+7},e.createLabel(n,o,{id:i.id+"_label",businessObject:i,di:n.di})}},this.execute=function(e){return e.oldLabel=Ur(e.element),i(e.element,e.newLabel)},this.revert=function(e){return i(e.element,e.oldLabel)},this.postExecute=function(n){var i=n.element,r=i.label||i,o=n.newLabel,a=n.newBounds,s=n.hints||{};if(cn(r)||vr(r,"bpmn:TextAnnotation"))if(cn(r)&&cv(o))!1!==s.removeShape&&e.removeShape(r,{unsetLabel:!1});else{var c=Ur(i);void 0===a&&(a=t.getExternalLabelBounds(r,c)),a&&e.resizeShape(r,a,av)}}}function cv(e){return!e||!e.trim()}function pv(e,t,n,i){Im.call(this,e,t,n),this._bpmnRules=i}function lv(){}sv.$inject=["modeling","textRenderer","bpmnFactory"],e(pv,Im),pv.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],pv.prototype.getHandlers=function(){var e=Im.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Fm,e["element.updateProperties"]=Um,e["canvas.updateRoot"]=Xm,e["lane.add"]=Zm,e["lane.resize"]=Jm,e["lane.split"]=Qm,e["lane.updateRefs"]=nv,e["id.updateClaim"]=iv,e["element.setColor"]=ov,e["element.updateLabel"]=sv,e},pv.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},pv.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},pv.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},pv.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},pv.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},pv
[all...]
/plugin/diagramsnet/lib/js/
H A Dextensions.min.js1705pv,u:ev,U:nv,V:rv,w:tv,W:iv,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,… function
/plugin/xlsx2dw/packages/exceljs/
H A Dexceljs.js5151 this._headerRowCount = value.reduce(function (pv, cv) {
5153 return Math.max(pv, headerCount);

12