prefig 0.4.6.dev20250929053415__tar.gz → 0.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/PKG-INFO +4 -4
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/arrow.py +6 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/diagram.py +44 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/repeat.py +34 -3
- prefig-0.4.8/prefig/resources/diagcess/diagcess.js +7 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/schema/pf_schema.rnc +4 -2
- prefig-0.4.8/prefig/resources/schema/pf_schema.rng +2250 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/pyproject.toml +4 -4
- prefig-0.4.6.dev20250929053415/prefig/resources/diagcess/diagcess.js +0 -1
- prefig-0.4.6.dev20250929053415/prefig/resources/schema/pf_schema.rng +0 -787
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/LICENSE +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/README.md +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/__init__.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/cli.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/CTM.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/__init__.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/annotations.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/area.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/axes.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/calculus.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/circle.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/clip.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/compat.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/coordinates.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/definition.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/diffeqs.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/graph.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/grid_axes.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/group.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/image.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/implicit.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/label.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/label_tools.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/legend.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/line.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/math_utilities.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/network.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/parametric_curve.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/parse.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/path.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/point.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/polygon.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/read.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/rectangle.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/riemann_sum.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/shape.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/slope_field.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/statistics.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/tags.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/tangent_line.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/user_namespace.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/utilities.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/core/vector.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/engine.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/diagcess/diagcess.html +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/de-system.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/derivatives.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/diffeqs.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/implicit.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/projection.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/riemann.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/roots_of_unity.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/examples/tangent.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/fonts/Braille29.ttf +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/js/mj-sre-page.js +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/js/package.json +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/resources/template/pf_publication.xml +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/scripts/__init__.py +0 -0
- {prefig-0.4.6.dev20250929053415 → prefig-0.4.8}/prefig/scripts/install_mj.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: prefig
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: An authoring system for mathematical diagrams
|
|
5
5
|
Home-page: https://prefigure.org
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -15,12 +15,12 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
15
15
|
Provides-Extra: text
|
|
16
16
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
17
17
|
Requires-Dist: click-log (>=0.4.0,<0.5.0)
|
|
18
|
-
Requires-Dist: lxml (>=
|
|
18
|
+
Requires-Dist: lxml (>=6,<7)
|
|
19
19
|
Requires-Dist: networkx (>=2.5,<3.0)
|
|
20
20
|
Requires-Dist: numpy (>=1.26,<2.0) ; python_version < "3.13"
|
|
21
|
-
Requires-Dist: numpy (>=2.1.0,<3.0.0) ; python_version
|
|
21
|
+
Requires-Dist: numpy (>=2.1.0,<3.0.0) ; python_version >= "3.13"
|
|
22
22
|
Requires-Dist: pycairo (>=1.20,<2.0) ; extra == "text"
|
|
23
|
-
Requires-Dist: scipy (>=1.14.1,<2.0.0) ; python_version
|
|
23
|
+
Requires-Dist: scipy (>=1.14.1,<2.0.0) ; python_version >= "3.13"
|
|
24
24
|
Requires-Dist: scipy (>=1.8,<2.0) ; python_version < "3.13"
|
|
25
25
|
Requires-Dist: shapely (>=2.0.6,<3.0.0)
|
|
26
26
|
Project-URL: Repository, https://github.com/davidaustinm/prefigure
|
|
@@ -5,6 +5,7 @@ import numpy as np
|
|
|
5
5
|
from . import utilities as util
|
|
6
6
|
from . import CTM
|
|
7
7
|
from . import user_namespace as un
|
|
8
|
+
from . import repeat
|
|
8
9
|
|
|
9
10
|
log = logging.getLogger('prefigure')
|
|
10
11
|
|
|
@@ -189,6 +190,11 @@ def add_arrowhead_marker(diagram,
|
|
|
189
190
|
arrow_width = 13/3
|
|
190
191
|
dims = (1, arrow_width) #11/3)
|
|
191
192
|
|
|
193
|
+
# EPUB does not allow some characters to appear in @id
|
|
194
|
+
# There is a possibility that we have # or . so we will
|
|
195
|
+
# replace them with this function call
|
|
196
|
+
id = repeat.epub_clean(id)
|
|
197
|
+
|
|
192
198
|
# If we've already created this one, we'll just move on
|
|
193
199
|
if diagram.has_reusable(id):
|
|
194
200
|
return id
|
|
@@ -3,6 +3,7 @@ import lxml.etree as ET
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
import logging
|
|
5
5
|
import copy
|
|
6
|
+
import re
|
|
6
7
|
from . import tags
|
|
7
8
|
from . import user_namespace as un
|
|
8
9
|
from . import utilities as util
|
|
@@ -10,9 +11,13 @@ from . import CTM
|
|
|
10
11
|
from . import label
|
|
11
12
|
from . import math_utilities as math_util
|
|
12
13
|
from . import annotations
|
|
14
|
+
from . import repeat
|
|
13
15
|
|
|
14
16
|
log = logging.getLogger('prefigure')
|
|
15
17
|
|
|
18
|
+
# regular expression to check if id is EPUB compliant
|
|
19
|
+
epub_id_check = re.compile('^[A-Za-z0-9_-]+$')
|
|
20
|
+
|
|
16
21
|
class Diagram:
|
|
17
22
|
def __init__(self,
|
|
18
23
|
diagram_element,
|
|
@@ -129,9 +134,26 @@ class Diagram:
|
|
|
129
134
|
for child in templates_element:
|
|
130
135
|
self.defaults[child.tag] = child
|
|
131
136
|
|
|
137
|
+
author_annotations = self.diagram_element.xpath('.//annotations')
|
|
138
|
+
self.author_annotations_present = len(author_annotations) > 0
|
|
139
|
+
if self.author_annotations_present:
|
|
140
|
+
self.check_annotation_ref(author_annotations[0])
|
|
141
|
+
|
|
132
142
|
if self.defaults.get('macros', None) is not None:
|
|
133
143
|
label.add_macros(self.defaults.get('macros').text)
|
|
134
144
|
|
|
145
|
+
def check_annotation_ref(self, element):
|
|
146
|
+
ref = element.get('ref', None)
|
|
147
|
+
if ref is not None:
|
|
148
|
+
if not bool(epub_id_check.fullmatch(ref)):
|
|
149
|
+
log.error(f"@ref {ref} in an annotation has characters disallowed by EPUB")
|
|
150
|
+
log.error(" We will replace these characters but there may be unexpected behavior")
|
|
151
|
+
log.error(" Search for EPUB in the PreFigure documentation https://prefigure.org")
|
|
152
|
+
ref = repeat.epub_clean(ref)
|
|
153
|
+
element.set('ref', ref)
|
|
154
|
+
for child in element:
|
|
155
|
+
self.check_annotation_ref(child)
|
|
156
|
+
|
|
135
157
|
def add_legend(self, legend):
|
|
136
158
|
self.legends.append(legend)
|
|
137
159
|
|
|
@@ -276,6 +298,7 @@ class Diagram:
|
|
|
276
298
|
h = height + margins[1]+margins[3]
|
|
277
299
|
self.root.set("width", str(w))
|
|
278
300
|
self.root.set("height", str(h))
|
|
301
|
+
self.root.set("viewBox", f"0 0 {w} {h}")
|
|
279
302
|
|
|
280
303
|
# initialize the CTM and push it onto the CTM stack
|
|
281
304
|
ctm.translate(0, height + margins[1] + margins[3])
|
|
@@ -380,6 +403,18 @@ class Diagram:
|
|
|
380
403
|
log.error(f"Unable to write SVG at {out+'.svg'}")
|
|
381
404
|
return
|
|
382
405
|
|
|
406
|
+
if self.author_annotations_present and self.environment == "pretext":
|
|
407
|
+
# we will write out a second version of the diagram
|
|
408
|
+
# without the height and width attributes for diagcess use
|
|
409
|
+
self.root.attrib.pop("height")
|
|
410
|
+
self.root.attrib.pop("width")
|
|
411
|
+
try:
|
|
412
|
+
with ET.xmlfile(out + '-diagcess.svg', encoding='utf-8') as xf:
|
|
413
|
+
xf.write(self.root, pretty_print=True)
|
|
414
|
+
except:
|
|
415
|
+
log.error(f"Unable to write SVG at {out+'-diagcess.svg'}")
|
|
416
|
+
return
|
|
417
|
+
|
|
383
418
|
if self.annotations_root is not None:
|
|
384
419
|
diagram = ET.Element('diagram')
|
|
385
420
|
diagram.append(self.annotations_root)
|
|
@@ -436,6 +471,15 @@ class Diagram:
|
|
|
436
471
|
# we're publicly using 'at' rather than 'id' for handles
|
|
437
472
|
if child.get('at') is not None:
|
|
438
473
|
child.set('id', child.get('at'))
|
|
474
|
+
|
|
475
|
+
child_id = child.get('id', None)
|
|
476
|
+
if child_id is not None:
|
|
477
|
+
if not bool(epub_id_check.fullmatch(child_id)):
|
|
478
|
+
log.error(f"The id {child_id} has characters disallowed by EPUB")
|
|
479
|
+
log.error(" We will substitute disallowed characters to make the id EPUB compliant")
|
|
480
|
+
log.error(" Search for EPUB in the PreFigure documentation at https://prefigure.org")
|
|
481
|
+
child.set('id', repeat.epub_clean(child_id))
|
|
482
|
+
|
|
439
483
|
# see if the publication flie has any defaults
|
|
440
484
|
defaults = self.defaults.get(child.tag, None)
|
|
441
485
|
if defaults is not None:
|
|
@@ -2,6 +2,7 @@ import lxml.etree as ET
|
|
|
2
2
|
import logging
|
|
3
3
|
from . import user_namespace as un
|
|
4
4
|
import copy
|
|
5
|
+
import re
|
|
5
6
|
import numpy as np
|
|
6
7
|
from . import group
|
|
7
8
|
from . import label
|
|
@@ -9,6 +10,25 @@ from . import utilities
|
|
|
9
10
|
|
|
10
11
|
log = logging.getLogger('prefigure')
|
|
11
12
|
|
|
13
|
+
# EPUB restricts the characters that can appear in an id to
|
|
14
|
+
# a-z|A-Z|0-9|_|-
|
|
15
|
+
# This is an issue here since <repeat> elements can create id's
|
|
16
|
+
# This regular expression checks characters to see if they are allowed
|
|
17
|
+
epub_check = re.compile(r'[A-Za-z0-9_-]')
|
|
18
|
+
|
|
19
|
+
# We also define substitutions for the most common disallowed characters
|
|
20
|
+
epub_dict = {'(': 'p',
|
|
21
|
+
')': 'q',
|
|
22
|
+
'[': 'p',
|
|
23
|
+
']': 'q',
|
|
24
|
+
'{': 'p',
|
|
25
|
+
'}': 'q',
|
|
26
|
+
',': 'c',
|
|
27
|
+
'.': 'd',
|
|
28
|
+
'=': '_',
|
|
29
|
+
r'#': 'h'}
|
|
30
|
+
|
|
31
|
+
|
|
12
32
|
# Allows a block of XML to repeat with a changing parameter
|
|
13
33
|
|
|
14
34
|
def repeat(element, diagram, parent, outline_status):
|
|
@@ -48,11 +68,12 @@ def repeat(element, diagram, parent, outline_status):
|
|
|
48
68
|
else:
|
|
49
69
|
k_str = str(k)
|
|
50
70
|
|
|
51
|
-
|
|
71
|
+
k_str_clean = epub_clean(k_str)
|
|
72
|
+
# This is a change since we use the syntax "var_str" for the id suffix
|
|
52
73
|
if count:
|
|
53
|
-
suffix_str = var + "
|
|
74
|
+
suffix_str = var + "_" + k_str_clean
|
|
54
75
|
else:
|
|
55
|
-
suffix_str = var + "
|
|
76
|
+
suffix_str = var + "_" + str(num)
|
|
56
77
|
|
|
57
78
|
definition = ET.SubElement(element, 'definition')
|
|
58
79
|
definition.text = var + '=' + k_str
|
|
@@ -78,3 +99,13 @@ def repeat(element, diagram, parent, outline_status):
|
|
|
78
99
|
|
|
79
100
|
if annotation is not None:
|
|
80
101
|
diagram.pop_from_annotation_branch()
|
|
102
|
+
|
|
103
|
+
def epub_clean(s):
|
|
104
|
+
epub_clean = [bool(epub_check.fullmatch(ch)) for ch in s]
|
|
105
|
+
chars = []
|
|
106
|
+
for index, ch in enumerate(s):
|
|
107
|
+
if epub_clean[index]:
|
|
108
|
+
chars.append(ch)
|
|
109
|
+
continue
|
|
110
|
+
chars.append(epub_dict.get(ch, '_'))
|
|
111
|
+
return "".join(chars)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skipped minification because the original files appears to be already minified.
|
|
3
|
+
* Original file: /npm/diagcess@1.3.3/dist/diagcess.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.diagcess=e():t.diagcess=e()}(this,()=>(()=>{"use strict";var t={38:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CustomEvent=e.EventType=e.KeyCodes=void 0,function(t){t[t.RETURN=13]="RETURN",t[t.ENTER=13]="ENTER",t[t.ESC=27]="ESC",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.COMMA=188]="COMMA",t[t.PERIOD=190]="PERIOD"}(e.KeyCodes||(e.KeyCodes={})),function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSEMOVE="mousemove",t.SELECTSTART="selectstart",t.KEYPRESS="keypress",t.KEYDOWN="keydown",t.KEYUP="keyup",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.TOUCHCANCEL="touchcancel"}(e.EventType||(e.EventType={}));var n=function(){function t(t,e,n){this.src=t,this.type=e,this.callback=n,this.src=t,this.type=e,this.callback=n}return t.prototype.add=function(){this.src.addEventListener(this.type,this.callback)},t.prototype.remove=function(){this.src.removeEventListener(this.type,this.callback)},t}();e.CustomEvent=n},108:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ChemObj=void 0;var r=n(502),i=["circular"],c=function(){function t(t,e){var n,c;this.annotation_=t,this.diagram_=e,this.drawnElements=null,this.attributes=new Map,this.up=null,this.down=[],this.link=!1,this.drawn_=null,this.id_=this.getId_(),this.parent_=this.getParent_(),this.position=this.getPosition_();try{for(var a=o(i),s=a.next();!s.done;s=a.next()){var l=s.value,u=r.getAttribute(t,l);u&&this.attributes.set(l,u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(n)throw n.error}}}return t.prototype.getAnnotation=function(){return this.annotation_},t.prototype.getDiagram=function(){return this.diagram_},t.prototype.getId=function(){return this.id_},t.prototype.setDrawnElement=function(t){this.drawn_=t},t.prototype.getDrawnElement=function(){return this.drawn_},t.prototype.getDrawnElements=function(){return this.drawnElements||(this.drawnElements=[],this.drawn_&&this.drawnElements.push(this.drawn_)),this.drawnElements},t.prototype.complete=function(){if(this.down.length&&this.down.sort(function(t,e){return!t.position&&e.position?1:t.position-e.position}),this.parent_){var t=this.getDiagram().get(this.parent_);this.up=t,t.down.push(this)}},t.prototype.getParent=function(){return this.parent_},t.prototype.getKey=function(){return this.id_+this.parent_},t.prototype.getUp=function(){return this.up?[this.up]:[]},t.prototype.getDown=function(){return this.down},t.prototype.getRight=function(){if(!this.up)return[];var t=this.up.getDown(),e=t.indexOf(this);if(t.length>e+1){var n=t[e+1];return n.position?[n]:[]}return this.up.attributes.get("circular")?[t[0]]:[]},t.prototype.getLeft=function(){if(!this.up)return[];var t=this.up.getDown(),e=t.indexOf(this);if(e>0){var n=t[e-1];return n.position?[n]:[]}return this.up.attributes.get("circular")?[t[t.length-1]]:[]},t.prototype.getId_=function(){var t=this.getAnnotation().firstElementChild;return t?t.textContent:""},t.prototype.getParent_=function(){var t=this.getAnnotation().querySelector("parents > *");return t?r.getTextContent(t):""},t.prototype.getPosition_=function(){return parseInt(r.getTextContent(this.getAnnotation().querySelector("position")),10)},t}();e.ChemObj=c},187:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Diagram=void 0;var n=function(){function t(t){this.languages=t,this.diagram_={}}return t.prototype.set=function(t,e){this.diagram_[t]=e},t.prototype.get=function(t){return this.diagram_[t]},t.prototype.forEach=function(t){for(var e in this.diagram_)t.call(this,this.diagram_[e])},t.prototype.find=function(t){for(var e in this.diagram_){var n=this.diagram_[e];if(t.call(this,n))return n}return null},t.prototype.translate=function(t){return this.languages?this.languages.translate(t):t},t.prototype.nextLanguage=function(){return this.languages?(this.languages.nextLanguage(),this.languages.active):null},t}();e.Diagram=n},196:(t,e,n)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.rewriteUseElements=e.rewriteTransformations=e.SelectedElements=e.SelectedTypes=void 0;var r,i=n(502),c=["text","polyline","line","rect","polygon","use","circle","path"],a=["stroke","stroke-width","color","fill","background-color","transform"];function s(t){var e=t,n=[];do{var o=e.getAttribute("transform");o&&n.unshift(o),e=e.parentNode}while("svg"!==e.tagName);return t.setAttribute("transform",n.join(" ")),t}function l(t){var e=document.createElementNS("http://www.w3.org/2000/svg","g"),n=t.getAttribute("id");return n&&(e.setAttribute("id",n),t.removeAttribute("id")),t.parentNode.replaceChild(e,t),e.appendChild(t),e}function u(t){var e=t;do{(e=e.parentNode).removeAttribute("transform")}while("svg"!==e.tagName)}!function(t){t.DEFS="defs",t.SUB_DEFS="subDefs",t.SUB_SVG="subSvg"}(r=e.SelectedTypes||(e.SelectedTypes={})),e.SelectedElements=((o={})[r.DEFS]=[],o[r.SUB_DEFS]=[],o[r.SUB_SVG]=[],o),e.rewriteTransformations=function(t){var n=i.toArray(t.querySelectorAll(c.join(",")));e.SelectedElements.SUB_SVG=i.toArray(t.querySelectorAll("svg svg"));var o=i.toArray(t.querySelectorAll(c.map(function(t){return"svg svg "+t}).join(",")));e.SelectedElements.SUB_DEFS=i.toArray(t.querySelectorAll(c.map(function(t){return"svg defs "+t}).join(",")));var r=n.filter(function(t){return!o.includes(t)&&!e.SelectedElements.SUB_DEFS.includes(t)});return function(t,e){e.forEach(s),t.forEach(s),e.forEach(u),t.forEach(u),e.forEach(function(t){var e=l(t),n=t.getAttribute("transform");n&&(e.setAttribute("transform",n),t.removeAttribute("transform"))}),t.filter(function(t){return t.hasAttribute("id")}).forEach(l)}(r,e.SelectedElements.SUB_SVG),r},e.rewriteUseElements=function(t){var n=a.map(function(t){return"".concat(t,":inherit;")}).join(" ");e.SelectedElements.SUB_DEFS.forEach(function(t){var o,r=null===(o=t.parentElement)||void 0===o?void 0:o.parentElement;r&&e.SelectedElements.SUB_SVG.includes(r)||t.setAttribute("style",n)})}},216:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ControllerFactory=void 0;var r=n(225),i=n(226),c=n(778),a=n(853),s=n(881),l=n(234),u=n(875);!function(t){var e,n=((e={})[r.magnifiers.SIMPLE]=function(t){return new a.SimpleMagnifier(t)},e[r.magnifiers.STEP]=function(t){return new a.StepMagnifier(t)},e[r.magnifiers.DUMMY]=function(t){return new a.DummyMagnifier(t)},e[r.colors.MONOCHROME]=function(t){return new i.Monochrome(t)},e[r.colors.CONTRAST]=function(t){return new i.Contrast(t)},e[r.speech.DETAIL]=function(t){return new u.Detail(t)},e[r.speech.EXPERT]=function(t){return new u.Expert(t)},e[r.speech.LANGUAGE]=function(t){return new u.Language(t)},e[r.regions.SPEECH]=function(t){return new s.Speech(t)},e[r.regions.SUBTITLE]=function(t){return new s.Subtitle(t)},e[r.explorers.KEY]=function(t){return new c.KeyExplorer(t)},e[r.explorers.MENU]=function(t){return new c.MenuExplorer(t)},e[r.sound.OSCILLATOR]=function(t){return new l.Oscillator(t)},e[r.sound.VOICING]=function(t){return new l.Voicing(t)},e);t.get=function(t){var e,i,c=[],a=[].concat(r.options.magnifiers,r.options.regions,r.options.colors,r.options.speech,r.options.sound,r.options.explorers);try{for(var s=o(a),l=s.next();!l.done;l=s.next()){var u=l.value,p=n[u];if(p){var h=p(t);c.push(h)}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}return c}}(e.ControllerFactory||(e.ControllerFactory={}))},221:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractController=void 0;var r=n(38),i=function(){function t(t){this.container=t,this._active=!1,this.internalEvents_=[],this.customEvents()}return Object.defineProperty(t.prototype,"active",{get:function(){return this._active},set:function(t){this._active=t},enumerable:!1,configurable:!0}),t.prototype.activate=function(){this.active=!0,this.addEvents()},t.prototype.deactivate=function(){this.removeEvents(),this.active=!1},t.prototype.registerEvent=function(t,e,n){this.internalEvents_.push(new r.CustomEvent(t,e,n))},t.prototype.addEvents=function(){var t,e;try{for(var n=o(this.internalEvents_),r=n.next();!r.done;r=n.next()){r.value.add()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.removeEvents=function(){var t,e;try{for(var n=o(this.internalEvents_),r=n.next();!r.done;r=n.next()){r.value.remove()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t}();e.AbstractController=i},225:(t,e)=>{var n,o,r,i,c,a;Object.defineProperty(e,"__esModule",{value:!0}),e.config=e.options=e.sound=e.speech=e.colors=e.regions=e.magnifiers=e.explorers=e.version=void 0,e.version="1.3.3",function(t){t.KEY="key",t.MENU="menu"}(n=e.explorers||(e.explorers={})),function(t){t.DUMMY="dummy",t.STEP="step",t.SIMPLE="simple"}(o=e.magnifiers||(e.magnifiers={})),function(t){t.SUBTITLE="subtitle",t.SPEECH="speech"}(r=e.regions||(e.regions={})),function(t){t.MONOCHROME="monochrome",t.CONTRAST="contrast"}(i=e.colors||(e.colors={})),function(t){t.LANGUAGE="language",t.EXPERT="expert",t.DETAIL="detail"}(c=e.speech||(e.speech={})),function(t){t.OSCILLATOR="oscillator",t.VOICING="voicing"}(a=e.sound||(e.sound={})),e.options={explorers:[n.KEY,n.MENU],magnifiers:[o.STEP,o.SIMPLE,o.DUMMY],regions:[r.SUBTITLE,r.SPEECH],colors:[i.MONOCHROME,i.CONTRAST],speech:[c.LANGUAGE,c.EXPERT,c.DETAIL],sound:[a.OSCILLATOR,a.VOICING]},e.config={MSG_VISIBLE:!0,MAG_ACTIVE:o.STEP,SONIFY:!1,VOICING:!0,VOICE_LANG:"en",ACTIVE_LANG:"en",SUB_VISIBLE:!1,SUBTITLE:null,POLYLINE:!1}},226:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Contrast=e.Monochrome=e.AbstractColor=void 0;var i=n(854),c=n(38),a=n(225),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.update=function(){},e}(n(221).AbstractController);e.AbstractColor=s;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.colors.MONOCHROME,e}return r(e,t),e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){return e.keyCode===c.KeyCodes.T&&i.toggleMonochrome(t.container.molecule.svg),e.stopPropagation(),!1})},e}(s);e.Monochrome=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.colors.CONTRAST,e.scheme=0,e}return r(e,t),e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){return e.keyCode===c.KeyCodes.C&&t.container.replaceStyles(i.pickScheme(t.container.molecule,++t.scheme)),e.stopPropagation(),!1})},e}(s);e.Contrast=u},234:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Voicing=e.Oscillator=e.AbstractSoundController=void 0;var i=n(502),c=n(38),a=n(225),s=n(221),l=n(899),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.activate=function(){t.prototype.activate.call(this),this.active=this.on()},e.prototype.deactivate=function(){this.stop(),t.prototype.deactivate.call(this)},e.prototype.update=function(){this.stop()},e.prototype.getStopKey=function(){return c.KeyCodes.K},e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){return e.keyCode===t.getActivationKey()&&(t.active=!t.active,t.toggle(t.active),t.active?t.update():t.stop()),e.keyCode===t.getRepeatKey()&&t.update(),e.keyCode===t.getStopKey()&&t.stop(),e.stopPropagation(),!1})},e}(s.AbstractController);e.AbstractSoundController=u;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.sound.OSCILLATOR,e.currentOscillators=[],e}return r(e,t),e.prototype.update=function(){t.prototype.update.call(this),this.currentOscillators=l.Sonify.sonify(this.container.activeElement)},e.prototype.on=function(){return a.config.SONIFY},e.prototype.toggle=function(t){a.config.SONIFY=t},e.prototype.stop=function(){this.currentOscillators.forEach(function(t){return t.stop()})},e.prototype.getActivationKey=function(){return c.KeyCodes.O},e.prototype.getRepeatKey=function(){return c.KeyCodes.P},e}(u);e.Oscillator=p;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.sound.VOICING,e.languages=null,e}return r(e,t),e.prototype.update=function(){t.prototype.update.call(this);var e=new SpeechSynthesisUtterance(this.container.activeElement.getSpeech());e.lang=this.languages?this.languages.active:a.config.VOICE_LANG,speechSynthesis.speak(e)},e.prototype.activate=function(){i.hasSpeech()&&(this.languages=this.container.molecule.cmlStructure.getRootElement().getDiagram().languages,this.languages&&this.languages.updateActive(),t.prototype.activate.call(this))},e.prototype.getActivationKey=function(){return c.KeyCodes.Y},e.prototype.getRepeatKey=function(){return c.KeyCodes.U},e.prototype.on=function(){return a.config.VOICING},e.prototype.toggle=function(t){a.config.VOICING=t},e.prototype.stop=function(){i.hasSpeech()&&speechSynthesis.cancel()},e}(u);e.Voicing=h},270:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AtomSet=void 0;var c=n(502),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawnElements=function(){var t,e,n=this;if(this.drawnElements)return this.drawnElements;this.drawnElements=[];var o={},r=function(t){o[t.id]||(o[t.id]=!0,n.drawnElements.push(t))},a=this.getDrawnElement();a&&r(a);try{for(var s=i(this.getDown()),l=s.next();!l.done;l=s.next()){(h=l.value).getDrawnElements().forEach(r),(a=h.getDrawnElement())&&r(a)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}for(var u=this.getAnnotation().querySelectorAll("component bond,passive"),p=0;p<u.length;p++){var h,f=(0,c.getTextContent)(u[p]);(h=this.getDiagram().get(f)).getDrawnElements().forEach(r),(a=h.getDrawnElement())&&r(a)}return this.drawnElements},e}(n(736).NeighbourHood);e.AtomSet=a},280:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Bond=void 0;var i=n(502),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ends=[],e}return r(e,t),e.prototype.complete=function(){for(var t=this.getAnnotation().querySelectorAll("component > atom,active"),e=0,n=void 0;n=t[e];e++){var o=this.getDiagram().get((0,i.getTextContent)(n));o&&this.ends.push(o)}},e}(n(736).NeighbourHood);e.Bond=c},285:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Languages=void 0;var r=n(225),i=n(406),c=function(){function t(t){this.cmlDocument=t,this.languages={},this.insertLanguages(),this.active=this.defaultActive()}return t.createLanguages=function(e){return 0===Array.from(e.querySelectorAll("messages")).filter(function(t){return t.childNodes.length}).length?null:new t(e)},t.prototype.insertLanguages=function(){var t,e,n=this.cmlDocument.querySelectorAll("messages");try{for(var r=o(Array.from(n)),c=r.next();!c.done;c=r.next()){var a=c.value,s=a.querySelector("language");s&&(this.languages[s.textContent]=new i.Language(a))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.updateActive=function(){this.active=this.languages[r.config.ACTIVE_LANG]?r.config.ACTIVE_LANG:this.defaultActive()},t.prototype.defaultActive=function(){return this.languages[r.config.VOICE_LANG]?r.config.VOICE_LANG:Object.keys(this.languages)[0]},t.prototype.translate=function(t){return this.languages[this.active].translate(t)},t.prototype.nextLanguage=function(){var t=Object.keys(this.languages),e=t.indexOf(this.active)+1;this.active=t.length>e?t[e]:t[0],r.config.ACTIVE_LANG=this.active},t}();e.Languages=c},297:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Via=void 0;var o=n(502),r=function(){function t(t,e){this.neighbour_=t,this.annotation_=e,this.type_=o.getAttribute(this.annotation_,o.attr.TYPE);var n=o.children(this.annotation_);this.connectedBy_=this.getConnectedBy_(n[0]),"Connecting bond"===this.type_&&"external"===this.neighbour_.location&&(this.neighbour_.from().link=!0),void 0!==this.connectedBy_&&(this.connectedBy_.link=!0),this.position_=parseInt(o.getTextContent(n[1]),10)}return t.prototype.getDrawnElements=function(){return this.connectedBy_.getDrawnElements()||[]},t.prototype.getType=function(){return this.type_||""},t.prototype.getPosition=function(){return this.position_},t.prototype.getConnectedBy_=function(t){var e=this.neighbour_.from().getDiagram(),n=o.getTextContent(t),r=e.get(n);return r||e.get(n+this.neighbour_.from().getId())},t}();e.Via=r},343:function(t,e){var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Bbox=void 0;var o=function(){function t(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}return t.fromSvgRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.fromSvgViewBox=function(e){return new t(e.baseVal.x,e.baseVal.y,e.baseVal.width,e.baseVal.height)},t.getClipBox=function(t,e){var n=t.getBBox();if(0!==n.x||0!==n.y||0!==n.width||0!==n.height)return n;var o=t.cloneNode(!0);return e.appendChild(o),n=o.getBBox(),e.removeChild(o),n},t.combineClips=function(e,n){var o=e.map(function(e){return t.fromSvgRect(t.getClipBox(e,n))});if(1===o.length)return o[0];var r=o[0];return o.slice(1).reduce(function(t,e){return t.combine(e)},r)},t.getBboxStandard=function(t){var e,n,o,r,i,c=t.getBBox();if(0===c.x&&0===c.y&&0===c.width&&0===c.height&&t.childNodes&&(null===(e=t.childNodes[0])||void 0===e?void 0:e.transform)){var a=t.childNodes[0],s=void 0,l=void 0,u=void 0,p=void 0;if(a.x&&a.y&&a.width&&a.height)s=a.x.baseVal.value,l=a.y.baseVal.value,u=a.width.baseVal.value,p=a.height.baseVal.value;else{var h=a.getBBox();s=(null===(n=h.baseVal)||void 0===n?void 0:n.x)||h.x,l=(null===(o=h.baseVal)||void 0===o?void 0:o.y)||h.y,u=(null===(r=h.baseVal)||void 0===r?void 0:r.width)||h.width,p=(null===(i=h.baseVal)||void 0===i?void 0:i.height)||h.height}var f=t.ownerSVGElement.createSVGPoint(),v=a.transform.baseVal;f.x=s,f.y=l;for(var d=v.length-1;d>=0;d--)f=f.matrixTransform(v.getItem(d).matrix);c.x=f.x,c.y=f.y,c.width=u,c.height=p}return c},t.combineBboxes=function(e){var n=new Set,o=function(e){var o=t.getBboxStandard(e);return e.querySelectorAll("*[clip-path]").forEach(function(t){return n.add(t)}),o},r=t.fromSvgRect(o(e[0]));if(1===e.length)return r=t.performClipping(r,n);var i=e.slice(1).reduce(function(t,e){return t.combine(o(e))},r);return i=t.performClipping(i,n)},t.performClipping=function(e,o){var r,i;if(!o.size)return e;var c=o.values().next().value.ownerSVGElement,a=function(t){var e=new Map;return t.querySelectorAll("defs").forEach(function(t){t.childNodes.forEach(function(t){t instanceof SVGElement&&e.set(t.id,t)})}),e}(c),s=new Set;try{for(var l=n(o),u=l.next();!u.done;u=l.next()){var p=u.value.getAttribute("clip-path").match(/^url\(#(.*)\)/),h=p&&a.get(p[1]);h&&s.add(h)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s.forEach(function(n){var o=Array.from(n.childNodes).filter(function(t){return t.getBBox}),r=t.combineClips(o,c);e=e.intersect(r)}),e},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.width+e.width,this.height+e.height)},t.prototype.difference=function(t,e,n){var o=this.add(t.scale(-1));return e&&(o.x=o.x-e/2,o.width=o.width+e),n&&(o.y=o.y-n/2,o.height=o.height+n),o},t.prototype.scale=function(e){return new t(this.x*e,this.y*e,this.width*e,this.height*e)},t.prototype.combine=function(e){var n=Math.min(this.x,e.x),o=Math.min(this.y,e.y);return new t(n,o,Math.max(this.x+this.width,e.x+e.width)-n,Math.max(this.y+this.height,e.y+e.height)-o)},t.prototype.intersect=function(e){var n=Math.max(this.x,e.x),o=Math.max(this.y,e.y);return new t(n,o,Math.min(this.x+this.width,e.x+e.width)-n,Math.min(this.y+this.height,e.y+e.height)-o)},t.prototype.viewBoxValue=function(){return this.x+" "+this.y+" "+this.width+" "+this.height},t}();e.Bbox=o},406:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Language=void 0;var o=n(502),r=function(){function t(t){this.cmlDocument=t,this.messages={},this.language=this.getLanguage(),this.insertMessages()}return t.prototype.getLanguage=function(){var t=this.cmlDocument.querySelector("language");return t?t.textContent:""},t.prototype.insertMessages=function(){for(var t=this.cmlDocument.querySelectorAll("message"),e=0,n=void 0;n=t[e];e++)this.messages[(0,o.getAttribute)(n,"msg")]=n.textContent},t.prototype.translate=function(t){return this.messages[t]},t}();e.Language=r},428:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.ViewBox=e.ZoomOptions=void 0;var i=n(502),c=n(343),a=function(){};e.ZoomOptions=a;var s=function(){function t(t){this.svg=t,this.focusgroups=new Map,this.defaultZoomOptions={xPad:this.svg.width.baseVal.value/15,yPad:this.svg.height.baseVal.value/15,duration:100,delay:10,wait:0,callback:function(){}},this.reset()}return t.prototype.reset=function(){var t=c.Bbox.fromSvgRect(this.svg.getBBox()),e=new Set(Array.from(this.svg.querySelectorAll("svg *[clip-path]")));c.Bbox.performClipping(t,e)},t.prototype.setClass=function(t,e){for(var n=0;n<t.length;n++)i.classList.add(t[n],e)},t.prototype.clearClass=function(t,e){for(var n=0;n<t.length;n++)i.classList.remove(t[n],e)},t.prototype.clearActive=function(){var t,e;try{for(var n=o(this.focusgroups),i=n.next();!i.done;i=n.next()){var c=r(i.value,2),a=c[0],s=c[1];this.clearClass(s,a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.focusgroups.clear()},t.prototype.select=function(t,e){var n=e||"cacc-active",o=this.focusgroups.get(n);o&&this.clearClass(o,n),this.setClass(t,n),this.focusgroups.set(n,t)},t.prototype.zoom=function(t,e){var n=this.focusgroups.get(t);n&&0!==n.length&&this.setViewBox_(c.Bbox.combineBboxes(n),e)},t.prototype.setViewBox_=function(t,e){var n=this;if(e){for(var o=this.completeZoomOptions_(e),r=this.retrieveViewBox_(),i=t.difference(r,o.xPad,o.yPad),c=Math.ceil(o.duration/o.delay),a=i.scale(1/c),s=function(t){return function(){return n.svg.setAttribute("viewBox",r.add(a.scale(t)).viewBoxValue())}},l=1;l<=c;l++)setTimeout(s(l),l*o.delay);o.callback&&setTimeout(o.callback,o.wait+o.duration)}},t.prototype.completeZoomOptions_=function(t){return t?Object.assign({},this.defaultZoomOptions,t):this.defaultZoomOptions},t.prototype.retrieveViewBox_=function(){try{return c.Bbox.fromSvgViewBox(this.svg.viewBox)}catch(t){return new c.Bbox(0,0,0,0)}},t}();e.ViewBox=s},441:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.CML=void 0;var r=n(187),i=n(285),c=n(528),a=n(270),s=n(280),l=function(){function t(t){this.cmlDocument=t,this.root=null,this.map=new r.Diagram(i.Languages.createLanguages(t)),this.initMap_()}return t.prototype.getMap=function(){return this.map},t.prototype.getRootElement=function(){return this.root||(this.root=this.map.find(function(t){return!(t instanceof s.Bond||t.up)})),this.root},t.prototype.initMap_=function(){var t,e,n=Array.from(this.cmlDocument.querySelectorAll("annotations > annotation"));try{for(var r=o(n),i=r.next();!i.done;i=r.next()){var l=i.value,u=l.firstElementChild;if(u){var p=void 0;switch(u.localName.toLowerCase()){case"atom":case"active":p=new c.Atom(l,this.map),this.map.set(p.getKey(),p);break;case"bond":case"passive":p=new s.Bond(l,this.map),this.map.set(p.getId(),p);break;case"atomset":case"grouped":p=new a.AtomSet(l,this.map),this.map.set(p.getId(),p)}}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.map.forEach(function(t){return t.complete()})},t}();e.CML=l},502:(t,e)=>{function n(t){return e.prefix_+"-"+t}Object.defineProperty(e,"__esModule",{value:!0}),e.noMove=e.attr=e.hasSpeech=e.getDocument=e.children=e.classList=e.getAttribute=e.getTextContent=e.toggleExpertMode=e.EXPERT_MODE=e.toArray=e.getId=e.idCounter_=e.addPrefix=e.prefix_=void 0,e.prefix_="cacc",e.addPrefix=n,e.idCounter_=0,e.getId=function(){return n("Id-"+e.idCounter_++)},e.toArray=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},e.EXPERT_MODE=!0,e.toggleExpertMode=function(){e.EXPERT_MODE=!e.EXPERT_MODE},e.getTextContent=function(t){var e=t.textContent;return" "!==e&&(e=e.replace(/^\s*/,"")),e},e.getAttribute=function(t,e){return t.getAttribute(e)||t.getAttributeNS("http://www.chemaccess.org/sre-schema",e)||t.getAttribute("sre:"+e)},function(t){function e(t,e){t.classList&&t.classList.add?t.classList.add(e):t.className?o(t.className)?t.className.baseVal+=" "+e:t.className+=" "+e:t.className=e}function n(t,e){if(t.classList&&t.classList.remove&&t.classList.remove(e),t.className){var n=t.className;o(n)?n.baseVal=n.baseVal.replace(" "+e,""):t.className=t.className.replace(" "+e,"")}}function o(t){return"string"!=typeof t}t.add=e,t.remove=n,t.toggle=function(t,r){t.classList&&t.classList.toggle?t.classList.toggle(r):t.className?!function(t,e){return-1!==(o(t)?t.baseVal:t).search(e)}(t.className,r)?e(t,r):n(t,r):t.className=r}}(e.classList||(e.classList={})),e.children=function(t){if(t.children)return Array.prototype.slice.call(t.children);for(var e=[],n=t.childNodes,o=0,r=void 0;r=n[o];o++)1===r.nodeType&&e.push(r);return e},e.getDocument=function(){var t;return(null===(t=null===window||void 0===window?void 0:window.top)||void 0===t?void 0:t.document)||document},e.hasSpeech=function(){return!("undefined"==typeof speechSynthesis)},function(t){t.EXPERT_SPEECH="speech2",t.SIMPLE_SPEECH="speech",t.LOCATION="location",t.TYPE="type"}(e.attr||(e.attr={})),e.noMove=function(){var t=new AudioContext,e=t.createOscillator();e.frequency.value=300,e.connect(t.destination),e.start(t.currentTime),e.stop(t.currentTime+.05)}},516:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var i=n(765),c=n(502),a=n(854),s=n(225),l=n(626);!function(t){t.molMap={},t.init=function(e){var n,u,p,h;void 0===e&&(e=!1);var f=l.forDocument();if(Object.keys(f).length>0&&(a.documentCmlStyle(),s.config.SUBTITLE=function(){var t=c.getDocument(),e=t.createElement("p");e.classList.add("explorer"),e.classList.add("cacc-message");var n=a.getScheme_(1);e.style.cssText+="position:fixed;left:0;bottom:0;"+"background-color: ".concat(n.bkd,"; color: ").concat(n.frgd),a.regionStyle_(t.body),s.config.SUB_VISIBLE||e.classList.add("cacc-text-invisible");return e}()),e){try{for(var v=o(Object.values(t.molMap)),d=v.next();!d.done;d=v.next()){d.value.removeEvents()}}catch(t){n={error:t}}finally{try{d&&!d.done&&(u=v.return)&&u.call(v)}finally{if(n)throw n.error}}t.molMap={}}try{for(var g=o(Object.entries(f)),y=g.next();!y.done;y=g.next()){var m=r(y.value,2),E=m[0],b=m[1];t.molMap[E]||(t.molMap[E]=new i.Container(E,b))}}catch(t){p={error:t}}finally{try{y&&!y.done&&(h=g.return)&&h.call(g)}finally{if(p)throw p.error}}}}(e.Base||(e.Base={}))},528:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Atom=void 0;var c=n(502),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.speech="",e.links=!1,e}return r(e,t),e.prototype.getSpeech=function(){if(this.link&&this.links)return this.speakLinks();var t=[];this.neighbourhood.forEach(function(e){"external"!==e.location&&t.push(e.getSpeech())});var e=this.getMessage();return this.speech=this.getDiagram().translate(e)+" "+t.join(" "),this.speech},e.prototype.getDrawnElements=function(){if(this.drawnElements)return this.drawnElements;this.drawnElements=[];var t=this.getDrawnElement();t&&this.drawnElements.push(t);for(var e=this.getAnnotation().querySelectorAll("component *"),n=0;n<e.length;n++){(t=this.getDiagram().get((0,c.getTextContent)(e[n])).getDrawnElement())&&-1===this.drawnElements.indexOf(t)&&this.drawnElements.push(t)}return this.drawnElements},e.prototype.getUpperNeighbour_=function(){var t,e;try{for(var n=i(this.up.neighbourhood),o=n.next();!o.done;o=n.next()){var r=o.value;if(-1!==r.via().map(function(t){return t.getPosition()}).indexOf(this.position))return r}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},e.prototype.speakLinks=function(){var t=this.getUpperNeighbour_(),e=t?t.getSpeech():"";if(e)return e;var n=[];this.neighbourhood.forEach(function(t){"external"===t.location&&n.push(t.getSpeech())});var o=this.getMessage();return this.speech=this.getDiagram().translate(o)+" "+n.join(" "),this.speech},e}(n(736).NeighbourHood);e.Atom=a},626:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.fromUri_=e.getUrlParameters_=e.getParam_=e.getData_=e.getMol_=e.forDocument=void 0;var r=n(196),i=0;function c(t){if(t.querySelector("div.svg")){t.setAttribute("has-svg","true");var e=t.querySelector("div.svg > svg");r.rewriteTransformations(e),r.rewriteUseElements(e)}else a(t,"svg","data-src",".svg");t.querySelector("div.cml")?t.setAttribute("has-cml","true"):a(t,"cml","data-cml",".xml")}function a(t,e,n,o){var i=t.getAttribute(n)||s(t,n,o);i?u(i,function(n){if(n){t.setAttribute("has-"+e,"true");var o=document.createElement("div");o.classList.add(e),"svg"===e&&(r.rewriteTransformations(n),r.rewriteUseElements(n)),o.appendChild(n.documentElement),t.appendChild(o)}else t.setAttribute("has-"+e,"false")}):t.setAttribute("has-"+e,"false")}function s(t,e,n){if(!t.id)return null;var o=l()[t.id];return o?(o+=n,t.setAttribute(e,o),o):null}function l(){for(var t,e={},n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),o=0;o<n.length;o++)e[(t=n[o].split("="))[0]]=t[1];return e}function u(t,e){if("file:"!==location.protocol){var n=new DOMParser,o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&200===o.status&&e(n.parseFromString(o.responseText,"text/xml"))},o.open("GET",t,!0),o.send(null)}else e(null)}e.forDocument=function(t){var e,n,r=t||document,a=Array.from(r.querySelectorAll("div.ChemAccess-element")),s={};try{for(var l=o(a),u=l.next();!u.done;u=l.next()){var p=u.value;c(p),p.id||(p.id="ChemAccess-element"+i++),s[p.id]=p}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return s},e.getMol_=c,e.getData_=a,e.getParam_=s,e.getUrlParameters_=l,e.fromUri_=u},736:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.NeighbourHood=void 0;var i=n(502),c=n(108),a=n(914),s=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.neighbourhood=[],o}return r(e,t),e.prototype.complete=function(){t.prototype.complete.call(this);for(var e=this.getAnnotation().querySelectorAll("neighbours neighbour"),n=0,o=void 0;o=e[n];n++)this.neighbourhood.push(new a.Neighbour(this,o))},e.prototype.getSpeech=function(){return this.getDiagram().translate(this.getMessage())},e.prototype.getMessage=function(){var t=i.getAttribute(this.getAnnotation(),i.attr.EXPERT_SPEECH),e=i.getAttribute(this.getAnnotation(),i.attr.SIMPLE_SPEECH);return i.EXPERT_MODE?t||e:e||t},e.prototype.getNeighbours=function(){return this.neighbourhood},e}(c.ChemObj);e.NeighbourHood=s},765:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function c(t){try{s(o.next(t))}catch(t){i(t)}}function a(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,a)}s((o=o.apply(t,e||[])).next())})},c=this&&this.__generator||function(t,e){var n,o,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){c.label=a[1];break}if(6===a[0]&&c.label<r[1]){c.label=r[1],r=a;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(a);break}r[2]&&c.ops.pop(),c.trys.pop();continue}a=e.call(t,c)}catch(t){a=[6,t],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var l=n(854),u=n(38),p=n(225),h=n(221),f=n(216),v=n(981),d=n(428),g=function(t){function e(e,n){var o=t.call(this,null)||this;return o.key=e,o.mol=n,o.name="Container",o.controllers=[],o.initElement().then(function(){o.viewBox=new d.ViewBox(o.molecule.svg),o.controllers=o.controllers.concat(f.ControllerFactory.get(o)),o.styles=l.moleculeStyle(o.molecule),o.activeElement=o.molecule.cmlStructure.getRootElement(),o.customEvents(),o.getDefaultExplorer()}).catch(function(){console.error("Failed to initialize element ".concat(e))}),o}return r(e,t),e.loadElement=function(t){return i(this,void 0,void 0,function(){var e;return c(this,function(n){return e=0,[2,new Promise(function(n,o){var r=function(){t.hasAttribute("has-svg")&&t.hasAttribute("has-cml")?n():e>5?o(t):(e++,setTimeout(r,100))};r()}).catch(function(t){"true"!==t.getAttribute("has-svg")&&console.error("Failed to load SVG diagram."),"true"!==t.getAttribute("has-cml")&&console.error("Failed to load XML annotation.")})]})})},e.prototype.initElement=function(){return i(this,void 0,void 0,function(){var t=this;return c(this,function(n){return[2,e.loadElement(this.mol).then(function(){if("true"!==t.mol.getAttribute("has-svg")||"true"!==t.mol.getAttribute("has-cml"))return Promise.reject("Loading of components failed.");var e=t.mol.querySelector("div.svg").children[0],n=t.mol.querySelector("div.cml").children[0];return e&&n?(t.mol.setAttribute("tabindex","0"),t.mol.setAttribute("role","application"),e.setAttribute("aria-hidden","true"),n.setAttribute("aria-hidden","true"),t.mol.hasAttribute("aria-label")||t.mol.setAttribute("aria-label","Navigatable ".concat(n.tagName)),t.molecule=new v.Molecule(t.mol,e,n),Promise.resolve()):Promise.reject("Empty Diagram elements.")}).catch(function(t){console.error("Molecule Structure initialisation failed with:",t)})]})})},e.prototype.update=function(t){t&&(this.activeElement=t),this.controllers.forEach(function(t){t.active&&t.update()})},e.prototype.activate=function(){this.molecule.svg.parentElement&&(t.prototype.activate.call(this),this.addStyles(),this.controllers.forEach(function(t){return t.activate()}))},e.prototype.deactivate=function(){this.update(this.molecule.cmlStructure.getRootElement()),this.controllers.forEach(function(t){return t.deactivate()}),this.removeStyles(),t.prototype.deactivate.call(this)},e.prototype.replaceStyles=function(t){var e,n;this.removeStyles();try{for(var o=a(t),r=o.next();!r.done;r=o.next()){var i=r.value;this.styles.set(i.className,i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}this.addStyles()},e.prototype.customEvents=function(){var t,e=this;(null===(t=this.molecule)||void 0===t?void 0:t.node)&&(this.registerEvent(this.molecule.node,u.EventType.KEYDOWN,function(t){return t.keyCode===u.KeyCodes.SPACE&&(e.update(),t.preventDefault(),t.stopPropagation()),!1}),new u.CustomEvent(this.molecule.node,u.EventType.KEYDOWN,function(t){return e.defaultExplorer&&!e.active&&t.keyCode===u.KeyCodes.ENTER&&(e.defaultExplorer.active=!0,e.activate(),t.preventDefault(),t.stopPropagation()),!1}).add(),new u.CustomEvent(this.molecule.node,u.EventType.CLICK,function(t){return e.defaultExplorer&&!e.active&&(e.defaultExplorer.active=!0,e.activate(),t.stopPropagation()),!1}).add())},e.prototype.getDefaultExplorer=function(){this.defaultExplorer=this.controllers.find(function(t){return t.name===p.explorers.KEY}),this.defaultExplorer||(this.defaultExplorer=this.controllers.find(function(t){return t.name===p.explorers.MENU}))},e.prototype.addStyles=function(){var t,e;try{for(var n=a(this.styles),o=n.next();!o.done;o=n.next()){var r=s(o.value,2)[1];this.molecule.node.appendChild(r)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.prototype.removeStyles=function(){var t,e;try{for(var n=a(this.styles),o=n.next();!o.done;o=n.next()){var r=s(o.value,2)[1];try{this.molecule.node.removeChild(r)}catch(t){}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e}(h.AbstractController);e.Container=g},778:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MenuExplorer=e.KeyExplorer=e.AbstractExplorer=void 0;var i=n(502),c=n(38),a=n(225),s=function(t){function e(e){var n=t.call(this,e)||this;return n.container=e,n.setupControls(),n}return r(e,t),e.prototype.activate=function(){this.active&&(this.container.update(),this.addControls(),t.prototype.activate.call(this))},e.prototype.deactivate=function(){this.active&&(t.prototype.deactivate.call(this),this.removeControls())},e.prototype.addEvents=function(){this.active&&t.prototype.addEvents.call(this)},e.prototype.setupControls=function(){},e.prototype.addControls=function(){},e.prototype.removeControls=function(){},e.prototype.update=function(){},e.prototype.customEvents=function(){var t=this,e=this.container.molecule.node;new c.CustomEvent(e,c.EventType.KEYDOWN,function(e){return t.active&&e.keyCode===c.KeyCodes.ESC&&t.container.deactivate(),t.container.active||e.keyCode===t.getActivationKey()&&(t.active=!0,t.container.activate(),e.preventDefault()),e.stopPropagation(),!1}).add()},e}(n(221).AbstractController);e.AbstractExplorer=s;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.explorers.KEY,e}return r(e,t),e.prototype.setupControls=function(){var t=this,e=function(e,n){var o=n();o.length>0?t.container.update(o[0]):(0,i.noMove)(),e.preventDefault()};this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(n){switch(n.keyCode){case c.KeyCodes.DOWN:case c.KeyCodes.D:e(n,function(){return t.container.activeElement.getDown()});break;case c.KeyCodes.UP:case c.KeyCodes.E:e(n,function(){return t.container.activeElement.getUp()});break;case c.KeyCodes.RIGHT:case c.KeyCodes.F:e(n,function(){return t.container.activeElement.getRight()});break;case c.KeyCodes.LEFT:case c.KeyCodes.S:e(n,function(){return t.container.activeElement.getLeft()})}return n.stopPropagation(),!1})},e.prototype.getActivationKey=function(){return c.KeyCodes.A},e}(s);e.KeyExplorer=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.explorers.MENU,e}return r(e,t),e.prototype.setupControls=function(){var t=this,e=this.container.molecule.createElement("ul");e.classList.add("cacc-controls"),e.setAttribute("role","navigation"),this.control_=e;var n=function(e,n){var o=n();o.length>0?t.container.update(o[0]):(0,i.noMove)()},o=function(e,o){t.registerEvent(e,c.EventType.KEYDOWN,function(t){return t.keyCode!==c.KeyCodes.ENTER&&t.keyCode!==c.KeyCodes.SPACE||(n(0,o),t.preventDefault(),t.stopPropagation()),!1}),t.registerEvent(e,c.EventType.CLICK,function(t){return n(0,o),t.stopPropagation(),!1})};o(this.makeButton_("Down",e),function(){return t.container.activeElement.getDown()}),o(this.makeButton_("Up",e),function(){return t.container.activeElement.getUp()}),o(this.makeButton_("Next",e),function(){return t.container.activeElement.getRight()}),o(this.makeButton_("Previous",e),function(){return t.container.activeElement.getLeft()})},e.prototype.addControls=function(){var t=this.container.molecule.node,e=t.querySelector(".cacc-message");e?t.insertBefore(this.control_,e):t.appendChild(this.control_)},e.prototype.removeControls=function(){this.control_.parentNode.removeChild(this.control_)},e.prototype.getActivationKey=function(){return c.KeyCodes.B},e.prototype.makeButton_=function(t,e){var n=this.container.molecule.createElement("li");return n.setAttribute("role","button"),n.setAttribute("aria-controls",this.container.molecule.node.getAttribute("id")),n.classList.add("cacc-button"),n.setAttribute("tabindex","0"),n.setAttribute("title",t),n.appendChild(document.createTextNode(t)),e.appendChild(n),n},e}(s);e.MenuExplorer=u},853:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StepMagnifier=e.SimpleMagnifier=e.DummyMagnifier=e.AbstractMagnifier=void 0;var i=n(38),c=n(225),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),Object.defineProperty(e.prototype,"active",{get:function(){return this._active&&c.config.MAG_ACTIVE===this.name},set:function(t){this._active=t},enumerable:!1,configurable:!0}),e.prototype.update=function(){this.container.viewBox.select(this.container.activeElement.getDrawnElements())},e.prototype.deactivate=function(){this.active&&(this.container.viewBox.clearActive(),this.container.viewBox.reset(),t.prototype.deactivate.call(this))},e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,i.EventType.KEYDOWN,function(e){return e.keyCode===t.getActivationKey()&&c.config.MAG_ACTIVE!==t.name&&(c.config.MAG_ACTIVE=t.name,t.update()),e.stopPropagation(),!1})},e}(n(221).AbstractController);e.AbstractMagnifier=a;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=c.magnifiers.DUMMY,e}return r(e,t),e.prototype.getActivationKey=function(){return i.KeyCodes.N},e.prototype.update=function(){this.container.viewBox.reset(),t.prototype.update.call(this)},e}(a);e.DummyMagnifier=s;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=c.magnifiers.SIMPLE,e}return r(e,t),e.prototype.update=function(){this.container.viewBox.select(this.container.activeElement.getDrawnElements()),this.container.viewBox.zoom("cacc-active")},e.prototype.getActivationKey=function(){return i.KeyCodes.COMMA},e}(a);e.SimpleMagnifier=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=c.magnifiers.STEP,e.lastActive=null,e}return r(e,t),e.prototype.update=function(){var t=this.container.activeElement,e=this.container.viewBox,n=this.lastActive?this.lastActive.getDrawnElements():[];this.container.viewBox.select(t.getDrawnElements(),"cacc-almost"),e.select(t.getDrawnElements().concat(n),"cacc-dummy"),this.lastActive=t,e.zoom("cacc-dummy",{duration:250,delay:25,wait:300,callback:function(){e.select([],"cacc-almost"),e.select(t.getDrawnElements(),"cacc-active"),e.zoom("cacc-active",{duration:250,delay:25,wait:300})}})},e.prototype.getActivationKey=function(){return i.KeyCodes.M},e}(a);e.StepMagnifier=u},854:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.addStyle=e.replaceStyle_=e.removeStyle_=e.svgForegroundStyle_=e.svgBackgroundStyle_=e.svgHighlightStyle_=e.regionStyle_=e.svgBaseStyle_=e.nodeBackgroundStyle_=e.pickScheme=e.moleculeStyle=e.getScheme_=e.colorSchemes_=e.toggleMonochrome=e.toggleTextVisibility=e.documentCmlStyle=void 0;var r=n(502),i=n(225);function c(t){return e.colorSchemes_[t%e.colorSchemes_.length]}function a(t,e){var n=c(e);return[p(t,n.bkd),s(t,n.bkd),h(t,n.frgd),u(t,n.active,n.almost)]}function s(t,e){var n="";return f(n+="div.".concat(t.node.id," { background-color: ").concat(e,"; }"),"cacc-general-background")}function l(t){var e="svg."+t.id,n="";return n+="".concat(e," { overflow: hidden; }"),n+="".concat(e," text tspan[baseline-shift] { font-weight: 200; font-size: 13px; }"),n+="".concat(e," line, svg rect { stroke-width: 1.0; stroke-linecap: round; }"),n+="".concat(e," line.").concat("cacc-active",", svg g.").concat("cacc-active"," line { stroke-width: 3.0; }"),n+="".concat(e," line.").concat("cacc-almost",", svg g.").concat("cacc-almost"," line { stroke-width: 2.0; }"),n+="".concat(e," g.").concat("cacc-active"," text { font-weight: bold; }"),n+="".concat(e," g#gridSVG g.").concat("cacc-active"," text { font-weight: bold; }"),n+="ul.".concat("cacc-controls"," { list-style-type: none; }"),n+="".concat(e," polyline.").concat("cacc-active",", svg g.").concat("cacc-active"," polyline { stroke-width: 3.0; }"),n+="".concat(e," polyline.").concat("cacc-almost",", svg g.").concat("cacc-almost"," polyline { stroke-width: 2.0; }"),n+="".concat(e," polygon.").concat("cacc-active",", svg g.").concat("cacc-active"," polygon { stroke-width: 3.0; }"),n+="".concat(e," polygon.").concat("cacc-almost",", svg g.").concat("cacc-almost"," polygon { stroke-width: 2.0; }"),n+="".concat(e," path.").concat("cacc-active",", svg g.").concat("cacc-active"," path { stroke-width: 3.0; }"),n+="".concat(e," path.").concat("cacc-almost",", svg g.").concat("cacc-almost"," path { stroke-width: 2.0; }"),n+="".concat(e," rect.").concat("cacc-active",", svg g.").concat("cacc-active"," rect { stroke-width: 3.0; }"),n+="".concat(e," rect.").concat("cacc-almost",", svg g.").concat("cacc-almost"," rect { stroke-width: 2.0; }"),n+="".concat(e," circle.").concat("cacc-active",", svg g.").concat("cacc-active"," circle { stroke-width: 3.0; }"),n+="".concat(e," circle.").concat("cacc-almost",", svg g.").concat("cacc-almost"," circle { stroke-width: 2.0; }"),n+="".concat(e," ellipse.").concat("cacc-active",", svg g.").concat("cacc-active"," ellipse { stroke-width: 3.0; }"),n+="".concat(e," ellipse.").concat("cacc-almost",", svg g.").concat("cacc-almost"," ellipse { stroke-width: 2.0; }"),n+="".concat(e," use.").concat("cacc-active",", svg g.").concat("cacc-active"," use { stroke-width: 3.0; }"),f(n+="".concat(e," use.").concat("cacc-almost",", svg g.").concat("cacc-almost"," use { stroke-width: 2.0; }"),"cacc-base")}function u(t,e,n){var o="svg."+t.id,r="";return r+="".concat(o," line.").concat("cacc-active",", g.").concat("cacc-active"," line { stroke: ").concat(e,"; }"),r+="".concat(o," line.").concat("cacc-almost",", g.").concat("cacc-almost"," line { stroke: ").concat(n,"; }"),r+="".concat(o," g.").concat("cacc-active"," text { fill: ").concat(e,"; }"),r+="".concat(o," g.").concat("cacc-almost"," text { fill: ").concat(n,"; }"),r+="".concat(o," g#gridSVG g.").concat("cacc-active"," text { fill: ").concat(e,"; }"),r+="".concat(o," g#gridSVG g.").concat("cacc-almost"," text { fill: ").concat(n,"; }"),r+="".concat(o," polyline.").concat("cacc-active",", g.").concat("cacc-active"," polyline { stroke: ").concat(e,"; }"),r+="".concat(o," polyline.").concat("cacc-almost",", g.").concat("cacc-almost"," polyline { stroke: ").concat(n,"; }"),r+="".concat(o," polygon.").concat("cacc-active",", g.").concat("cacc-active"," polygon { stroke: ").concat(e,"; }"),r+="".concat(o," polygon.").concat("cacc-almost",", g.").concat("cacc-almost"," polygon { stroke: ").concat(n,"; }"),r+="".concat(o," path.").concat("cacc-active",", g.").concat("cacc-active"," path { stroke: ").concat(e,"; }"),r+="".concat(o," path.").concat("cacc-almost",", g.").concat("cacc-almost"," path { stroke: ").concat(n,"; }"),r+="".concat(o," rect.").concat("cacc-active",", g.").concat("cacc-active"," rect { stroke: ").concat(e,"; }"),r+="".concat(o," rect.").concat("cacc-almost",", g.").concat("cacc-almost"," rect { stroke: ").concat(n,"; }"),r+="".concat(o," circle.").concat("cacc-active",", g.").concat("cacc-active"," circle { stroke: ").concat(e,"; }"),r+="".concat(o," circle.").concat("cacc-almost",", g.").concat("cacc-almost"," circle { stroke: ").concat(n,"; }"),r+="".concat(o," ellipse.").concat("cacc-active",", g.").concat("cacc-active"," ellipse { stroke: ").concat(e,"; }"),r+="".concat(o," ellipse.").concat("cacc-almost",", g.").concat("cacc-almost"," ellipse { stroke: ").concat(n,"; }"),r+="".concat(o," use.").concat("cacc-active",", g.").concat("cacc-active"," use { stroke: ").concat(e,"; }"),f(r+="".concat(o," use.").concat("cacc-almost",", g.").concat("cacc-almost"," use { stroke: ").concat(n,"; }"),"cacc-color-highlight")}function p(t,e){var n="svg."+t.id,o="";return o+="".concat(n," { background-color: ").concat(e,"; }"),o+="".concat(n," g.atom rect { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="div.container { background-color: ".concat(e,"; }"),o+="p.".concat(t.id,".").concat("cacc-message"," { background-color: ").concat(e,"; }"),f(o+="p.".concat(t.id,".").concat("cacc-message",".").concat("cacc-text-invisible"," { color: ").concat(e,"; }"),"cacc-color-background")}function h(t,e){var n="svg."+t.id,o="";return o+="".concat(n," line { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n,".").concat("cacc-text-monochrome"," text"),o+=" { stroke: ".concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n," g#gridSVG text { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="div.container { color: ".concat(e,"; }"),o+="p.".concat(t.id,".").concat("cacc-message"," { color: ").concat(e,"; }"),o+="ul.".concat(t.id,".").concat("cacc-controls"," { color: ").concat(e,"; }"),i.config.POLYLINE&&(o+="".concat(n," polyline { stroke: ").concat(e,"; fill: ").concat(e,"; }")),o+="".concat(n," polygon { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n," path { stroke: ").concat(e,"; }"),o+="".concat(n," rect { stroke: ").concat(e,"; }"),o+="".concat(n," circle { stroke: ").concat(e,"; }"),o+="".concat(n," ellipse { stroke: ").concat(e,"; }"),f(o+="".concat(n," use { stroke: ").concat(e,"; }"),"cacc-color-elements")}function f(t,e){var n=document.createElement("style");return n.setAttribute("class",e),n.innerHTML=t,n}function v(t,e){var n=t.querySelector("style."+e);return!!n&&(t.removeChild(n),!0)}function d(t,e){t.appendChild(e)}e.documentCmlStyle=function(){document.body&&d(document.body,f("div.cml { display:none; }","cacc-cml"))},e.toggleTextVisibility=function(t){r.classList.toggle(t,"cacc-text-invisible")},e.toggleMonochrome=function(t){r.classList.toggle(t,"cacc-text-monochrome")},e.colorSchemes_=[{frgd:"#000",bkd:"#fff",active:"#fd6",almost:"#6df"},{frgd:"#fff",bkd:"#000",active:"#fd6",almost:"#6df"},{frgd:"#3C3",bkd:"#000",active:"#fd6",almost:"#6df"},{frgd:"#ee0",bkd:"#00e",active:"#4f4",almost:"#e3e"}],e.getScheme_=c,e.moleculeStyle=function(t){var e,n,r=new Map,i=l(t);r.set(i.className,i);try{for(var c=o(a(t,0)),s=c.next();!s.done;s=c.next()){var u=s.value;r.set(u.className,u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return r},e.pickScheme=a,e.nodeBackgroundStyle_=s,e.svgBaseStyle_=l,e.regionStyle_=function(t){d(t,f("p.".concat("cacc-message",".").concat("cacc-text-invisible"," { font-size: 0px; }"),"cacc-region"))},e.svgHighlightStyle_=u,e.svgBackgroundStyle_=p,e.svgForegroundStyle_=h,e.removeStyle_=v,e.replaceStyle_=function(t,e,n){v(t,n),d(t,f(e,n))},e.addStyle=d},875:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Language=e.Expert=e.Detail=e.AbstractSpeech=void 0;var i=n(502),c=n(38),a=n(225),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.update=function(){},e}(n(221).AbstractController);e.AbstractSpeech=s;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.speech.DETAIL,e}return r(e,t),e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){return e.keyCode===c.KeyCodes.W&&(t.container.activeElement.link?(t.container.activeElement.links=!0,t.container.update(),t.container.activeElement.links=!1):((0,i.toggleExpertMode)(),t.container.update(),(0,i.toggleExpertMode)())),e.stopPropagation(),!1})},e}(s);e.Detail=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.speech.EXPERT,e}return r(e,t),e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){return e.keyCode===c.KeyCodes.X&&((0,i.toggleExpertMode)(),t.container.update()),e.stopPropagation(),!1})},e}(s);e.Expert=u;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=a.speech.LANGUAGE,e}return r(e,t),e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,c.EventType.KEYDOWN,function(e){e.keyCode===c.KeyCodes.L&&(t.container.molecule.cmlStructure.getMap().nextLanguage()&&t.container.active&&t.container.update());return e.stopPropagation(),!1})},e}(s);e.Language=p},881:function(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Speech=e.Subtitle=e.LiveRegion=void 0;var i=n(502),c=n(854),a=n(38),s=n(225),l=function(t){function e(e){var n=t.call(this,e)||this;return n.container=e,n.setupMessage(),n}return r(e,t),e.prototype.setupMessage=function(){var t=this.container.molecule.createElement("p");t.classList.add("explorer"),t.setAttribute("aria-live","assertive"),i.hasSpeech()&&(speechSynthesis.onvoiceschanged=function(){speechSynthesis.getVoices().length&&t.removeAttribute("aria-live")}),t.setAttribute("tabindex","-1"),t.classList.add("cacc-message"),this.message=t},e.prototype.activate=function(){this.active||(this.addMessage(),t.prototype.activate.call(this))},e.prototype.deactivate=function(){this.active&&(t.prototype.deactivate.call(this),this.removeMessage())},e.prototype.removeMessage=function(){var t;null===(t=this.message.parentNode)||void 0===t||t.removeChild(this.message)},e.prototype.update=function(){this.message.textContent=this.container.activeElement.getSpeech()},e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,a.EventType.KEYDOWN,function(e){return e.keyCode===a.KeyCodes.Z&&(t.toggleMessageVisibility(),s.config.MSG_VISIBLE=!s.config.MSG_VISIBLE),e.stopPropagation(),!1})},e.prototype.toggleMessageVisibility=function(){c.toggleTextVisibility(this.message)},e}(n(221).AbstractController);e.LiveRegion=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=s.regions.SUBTITLE,e}return r(e,t),e.prototype.addMessage=function(){this.container.molecule.node.parentNode.appendChild(this.message),s.config.MSG_VISIBLE||this.message.classList.add("cacc-text-invisible")},e}(l);e.Subtitle=u;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name=s.regions.SPEECH,e}return r(e,t),e.prototype.setupMessage=function(){this.message=s.config.SUBTITLE},e.prototype.addMessage=function(){this.message.parentNode||i.getDocument().body.appendChild(this.message)},e.prototype.customEvents=function(){var t=this;this.registerEvent(this.container.molecule.node,a.EventType.KEYDOWN,function(e){return e.keyCode===a.KeyCodes.V&&(t.toggleMessageVisibility(),s.config.SUB_VISIBLE=!s.config.SUB_VISIBLE),e.stopPropagation(),!1})},e}(l);e.Speech=p},899:function(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Sonify=void 0;var r=n(502),i=function(){function t(t){this.path=[],this.points=[],this.context=new AudioContext,this.prepare(t),this.sonifiable=this.path.length}return t.sonify=function(e){var n=e.getAnnotation().querySelectorAll("sonification > *"),o=[];n.length&&(o=Array.from(n).map(function(t){var n=(0,r.getTextContent)(t),o=t.tagName.toLowerCase(),i=n+("active"!==o&&"sre:active"!==o?"":n===e.getId()?e.getParent():e.getId());return e.getDiagram().get(i)}));var i=new t(o);return i.sonifiable?i.sonify():[]},t.prototype.prepare=function(t){var e,n;try{for(var r=o(t),i=r.next();!i.done;i=r.next()){var c=i.value;if(c.getDrawnElement()){for(var a=c.getDrawnElement().querySelectorAll("polyline"),s=0;s<a.length;s++){var l=a[s];this.path.push(l);for(var u=0;u<l.points.length;u++)console.log(l.points[u]),this.points.push([l.points[u].x,l.points[u].y])}a=c.getDrawnElement().querySelectorAll("path");for(s=0;s<a.length;s++){l=a[s];this.path.push(l);for(u=0;u<l.getTotalLength();u+=1){var p=l.getPointAtLength(u);this.points.push([p.x,p.y])}}a=c.getDrawnElement().querySelectorAll("rect");for(s=0;s<a.length;s++){l=a[s];this.path.push(l),this.points.push([l.x.animVal.value,l.height.animVal.value?l.y.animVal.value+l.height.animVal.value:0])}}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.sonifyOld=function(){for(var e=[],n=0;n<this.points.length;n++){var o=this.context.createOscillator();e.push(o),o.frequency.value=this.points[n][1]?t.BASE_FREQUENCY+10*this.points[n][1]:0,o.type="sine",o.connect(this.context.destination);var r=void 0,i=void 0;this.points.length>20?(r=n/10+.01,i=n/10+.1):(r=n/2+.01,i=n/2+.5),o.start(this.context.currentTime+r),o.stop(this.context.currentTime+i)}return e},t.prototype.sonify=function(){var e,n,o=[],r=this.context.createOscillator();o.push(r),r.type="sine",r.connect(this.context.destination);for(var i=0;i<this.points.length;i++)this.points.length>20?(e=i/10+.01,n=i/10):(e=i/2+.01,n=i/2+.5),console.log(e),i?r.frequency.setValueAtTime(this.points[i][1]?t.BASE_FREQUENCY-this.points[i][1]:0,this.context.currentTime+n):(r.frequency.setValueAtTime(t.BASE_FREQUENCY-this.points[i][1],this.context.currentTime),r.start(this.context.currentTime));return r.stop(this.context.currentTime+n),o},t.prototype.smooth=function(){if(this.points.length){for(var e=[this.points[0]],n=0;n<this.points.length-1;n++){for(var o=this.points[n][0],r=this.points[n][1],i=this.points[n+1][0],c=this.points[n+1][1],a=Math.abs(o-i)/t.SMOOTH_VALUE,s=Math.abs(r-c)/t.SMOOTH_VALUE,l=Math.sign(c-r),u=1;u<t.SMOOTH_VALUE;u++)e.push([o+u*a,r+l*u*s]);e.push([i,c])}this.points=e}},t.BASE_FREQUENCY=300,t.SMOOTH_VALUE=4,t}();e.Sonify=i},914:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Neighbour=void 0;var o=n(502),r=n(297),i=function(){function t(t,e){var n=this;this.from_=t,this.annotation_=e,this.speech=null,this.speech2=null;var i=o.children(this.annotation_);this.to_=this.from_.getDiagram().get(o.getTextContent(i[0])),this.location=o.getAttribute(this.annotation_,o.attr.LOCATION),this.via_=i.slice(1).map(function(t){return new r.Via(n,t)})}return t.prototype.from=function(){return this.from_},t.prototype.to=function(){return this.to_},t.prototype.via=function(){return this.via_},t.prototype.getSpeech=function(){return this.from_.getDiagram().translate(this.getMessage())},t.prototype.getMessage=function(){if(o.EXPERT_MODE){if(this.speech2)return this.speech2;if(this.speech2=o.getAttribute(this.annotation_,o.attr.EXPERT_SPEECH),this.speech2)return this.speech2}return this.speech||(this.speech=o.getAttribute(this.annotation_,o.attr.SIMPLE_SPEECH)),this.speech},t}();e.Neighbour=i},981:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Molecule=void 0;var o=n(502),r=n(441),i=function(){function t(t,e,n){this.node=t,this.svg=e,this.cml=n,this.id=o.getId(),o.classList.add(this.svg,this.id),o.classList.add(this.cml,this.id),this.cmlStructure=new r.CML(this.cml),this.topLevelDescription=this.cmlStructure.getRootElement().getSpeech(),this.combine_()}return t.prototype.createElement=function(t){var e=document.createElement(t);return e.classList.add(this.id),e},t.prototype.combine_=function(){var t=this;this.cmlStructure.getMap().forEach(function(e){var n=t.svg.getElementById(e.getId());n&&e.setDrawnElement(n)})},t}();e.Molecule=i}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.Config=t.Base=void 0;var e=n(225),r=n(516);t.Base=r.Base,t.Config=e.config,t.version=e.version})(),o})());
|
|
@@ -48,7 +48,7 @@ DefinitionElements =
|
|
|
48
48
|
Derivative?,
|
|
49
49
|
DE-Solution?,
|
|
50
50
|
Define-Shapes?,
|
|
51
|
-
Read
|
|
51
|
+
Read?
|
|
52
52
|
|
|
53
53
|
Definition = element definition {
|
|
54
54
|
text,
|
|
@@ -177,7 +177,9 @@ LabelAttributes =
|
|
|
177
177
|
attribute rotate {text}?,
|
|
178
178
|
attribute clear-background {"yes"|"no"}?,
|
|
179
179
|
attribute background-margin {text}?,
|
|
180
|
-
attribute color {text}
|
|
180
|
+
attribute color {text}?,
|
|
181
|
+
attribute font {text}?,
|
|
182
|
+
attribute font-size {text}?
|
|
181
183
|
|
|
182
184
|
Math = element m {attribute color {text}? & text}
|
|
183
185
|
Bold = element b {attribute color {text}? & text & Italic*}
|