prefig 0.4.7__py3-none-any.whl → 0.5.0__py3-none-any.whl

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/core/diagram.py CHANGED
@@ -79,6 +79,9 @@ class Diagram:
79
79
  # a dictionary for holding shapes
80
80
  self.shape_dict = {}
81
81
 
82
+ # dictionary for saving graphical data
83
+ self.saved_data = {}
84
+
82
85
  # each SVG element will have an id, we'll store a count of ids here
83
86
  self.ids = {}
84
87
 
@@ -134,9 +137,10 @@ class Diagram:
134
137
  for child in templates_element:
135
138
  self.defaults[child.tag] = child
136
139
 
137
- annotations = self.diagram_element.xpath('.//annotations')
138
- if len(annotations) > 0:
139
- self.check_annotation_ref(annotations[0])
140
+ author_annotations = self.diagram_element.xpath('.//annotations')
141
+ self.author_annotations_present = len(author_annotations) > 0
142
+ if self.author_annotations_present:
143
+ self.check_annotation_ref(author_annotations[0])
140
144
 
141
145
  if self.defaults.get('macros', None) is not None:
142
146
  label.add_macros(self.defaults.get('macros').text)
@@ -234,6 +238,12 @@ class Diagram:
234
238
  log.error(f"Unable to apply inverse coordinate transform to {p}")
235
239
  return np.array([0,0])
236
240
 
241
+ def save_data(self, element, data):
242
+ self.saved_data[element] = data
243
+
244
+ def retrieve_data(self, element):
245
+ return self.saved_data.get(element, None)
246
+
237
247
  def begin_figure(self):
238
248
  # set up the dimensions of the diagram in SVG coordinates
239
249
  dims = self.diagram_element.get('dimensions')
@@ -297,6 +307,7 @@ class Diagram:
297
307
  h = height + margins[1]+margins[3]
298
308
  self.root.set("width", str(w))
299
309
  self.root.set("height", str(h))
310
+ self.root.set("viewBox", f"0 0 {w} {h}")
300
311
 
301
312
  # initialize the CTM and push it onto the CTM stack
302
313
  ctm.translate(0, height + margins[1] + margins[3])
@@ -401,6 +412,18 @@ class Diagram:
401
412
  log.error(f"Unable to write SVG at {out+'.svg'}")
402
413
  return
403
414
 
415
+ if self.author_annotations_present and self.environment == "pretext":
416
+ # we will write out a second version of the diagram
417
+ # without the height and width attributes for diagcess use
418
+ self.root.attrib.pop("height")
419
+ self.root.attrib.pop("width")
420
+ try:
421
+ with ET.xmlfile(out + '-diagcess.svg', encoding='utf-8') as xf:
422
+ xf.write(self.root, pretty_print=True)
423
+ except:
424
+ log.error(f"Unable to write SVG at {out+'-diagcess.svg'}")
425
+ return
426
+
404
427
  if self.annotations_root is not None:
405
428
  diagram = ET.Element('diagram')
406
429
  diagram.append(self.annotations_root)
prefig/core/grid_axes.py CHANGED
@@ -251,12 +251,14 @@ def grid(element, diagram, parent, outline_status):
251
251
  if x < bbox[0] or x > bbox[2]:
252
252
  continue
253
253
  line_el = line.mk_line((x,bbox[1]), (x,bbox[3]), diagram)
254
+ line_el.attrib.pop('id')
254
255
  grid.append(line_el)
255
256
 
256
257
  for y in y_positions:
257
258
  if y < bbox[1] or y > bbox[3]:
258
259
  continue
259
260
  line_el = line.mk_line((bbox[0], y), (bbox[2], y), diagram)
261
+ line_el.attrib.pop('id')
260
262
  grid.append(line_el)
261
263
 
262
264
 
prefig/core/line.py CHANGED
@@ -5,7 +5,11 @@ import logging
5
5
  from . import utilities as util
6
6
  from . import math_utilities as math_util
7
7
  from . import user_namespace as un
8
+ import copy
8
9
  from . import arrow
10
+ from . import group
11
+ from . import label
12
+ from . import CTM
9
13
 
10
14
  log = logging.getLogger('prefigure')
11
15
 
@@ -50,12 +54,24 @@ def line(element, diagram, parent, outline_status):
50
54
 
51
55
  line = mk_line(p1, p2, diagram, element.get('id', None),
52
56
  endpoint_offsets=endpoint_offsets)
57
+
58
+ # we need to hold on to the endpoints in case the line is labelled
59
+ # these are endpoints in SVG coordinates
60
+ x1 = float(line.get('x1'))
61
+ x2 = float(line.get('x2'))
62
+ y1 = float(line.get('y1'))
63
+ y2 = float(line.get('y2'))
64
+
65
+ q1 = np.array((x1, y1))
66
+ q2 = np.array((x2, y2))
67
+ diagram.save_data(element, {'q1': q1, 'q2': q2})
68
+
69
+ # now add the graphical attributes
53
70
  util.set_attr(element, 'stroke', 'black')
54
71
  util.set_attr(element, 'thickness', '2')
55
72
  if diagram.output_format() == 'tactile':
56
73
  element.set('stroke', 'black')
57
74
  util.add_attr(line, util.get_1d_attr(element))
58
- # line.set('type', 'line')
59
75
 
60
76
  arrows = int(element.get('arrows', '0'))
61
77
  forward = 'marker-end'
@@ -113,15 +129,38 @@ def line(element, diagram, parent, outline_status):
113
129
  diagram.add_outline(element, line, parent)
114
130
  finish_outline(element, diagram, parent)
115
131
  else:
132
+ original_parent = parent
133
+ parent = add_label(element, diagram, parent)
116
134
  parent.append(line)
117
135
 
136
+ # if no label has been added, then we're done
137
+ if original_parent == parent:
138
+ return
139
+
140
+ # if there is a label, then the id is on the outer <g> element
141
+ # so we need to remove it from the children
142
+ remove_id(parent)
143
+
118
144
  def finish_outline(element, diagram, parent):
145
+ original_parent = parent
146
+ parent = add_label(element, diagram, parent)
147
+
148
+ # if we've added a label, remove the id's from element under the parent <g>
149
+ if original_parent != parent:
150
+ remove_id(parent)
151
+
119
152
  diagram.finish_outline(element,
120
153
  element.get('stroke'),
121
154
  element.get('thickness'),
122
155
  element.get('fill', 'none'),
123
156
  parent)
124
157
 
158
+ def remove_id(el):
159
+ for child in el:
160
+ if child.get('id', None) is not None:
161
+ child.attrib.pop('id')
162
+ remove_id(child)
163
+
125
164
  # We'll be adding lines in other places so we'll use this more widely
126
165
  def mk_line(p0, p1, diagram, id = None, endpoint_offsets = None, user_coords = True):
127
166
  line = ET.Element('line')
@@ -176,3 +215,55 @@ def infinite_line(p0, p1, diagram, slope = None):
176
215
  if t_min > t_max:
177
216
  return None, None
178
217
  return [p + t * v for t in [t_min, t_max]]
218
+
219
+ def add_label(element, diagram, parent):
220
+ # Is there a label associated with point?
221
+ text = element.text
222
+
223
+ # is there a label here?
224
+ has_text = text is not None and len(text.strip()) > 0
225
+ all_comments = all([subel.tag is ET.Comment for subel in element])
226
+ if has_text or not all_comments:
227
+ # If there's a label, we'll bundle the label and point in a group
228
+ parent_group = ET.SubElement(parent, 'g')
229
+ diagram.add_id(parent_group, element.get('id'))
230
+
231
+ # Now we'll create a new XML element describing the label
232
+ el = copy.deepcopy(element)
233
+ el.tag = 'label'
234
+
235
+ data = diagram.retrieve_data(element)
236
+ q1 = data['q1']
237
+ q2 = data['q2']
238
+
239
+ label_location = un.valid_eval(element.get("label-location", "0.5"))
240
+ if label_location < 0:
241
+ label_location = -label_location
242
+ q1, q2 = q2, q1
243
+
244
+ el.set('user-coords', 'no')
245
+ diff = q2 - q1
246
+ d = math_util.length(diff)
247
+ angle = math.degrees(math.atan2(diff[1], diff[0]))
248
+ if diagram.output_format() == "tactile":
249
+ anchor = q1 + label_location * diff
250
+ el.set("anchor", f"({anchor[0]}, {anchor[1]})")
251
+ direction = (diff[1], diff[0])
252
+ alignment = label.get_alignment_from_direction(direction)
253
+ el.set("alignment", alignment)
254
+ label.label(el, diagram, parent_group)
255
+ else:
256
+ tform = CTM.translatestr(*q1)
257
+ tform += ' ' + CTM.rotatestr(-angle)
258
+ distance = d * label_location
259
+ g = ET.SubElement(parent_group, "g")
260
+ g.set("transform", tform)
261
+ el.set("anchor", f"({distance},0)")
262
+ el.set("alignment", "north")
263
+ label.label(el, diagram, g)
264
+
265
+ return parent_group
266
+
267
+ else:
268
+ return parent
269
+
@@ -1 +1,7 @@
1
- !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,(function(){return(()=>{"use strict";var t={422:(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)}},911: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(422),i=n(807);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; }"),f(n+="".concat(e," ellipse.").concat("cacc-almost",", svg g.").concat("cacc-almost"," ellipse { 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,"; }"),f(r+="".concat(o," ellipse.").concat("cacc-almost",", g.").concat("cacc-almost"," ellipse { 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,"; }"),f(o+="".concat(n," ellipse { 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 d(t,e){var n=t.querySelector("style."+e);return!!n&&(t.removeChild(n),!0)}function v(t,e){t.appendChild(e)}e.documentCmlStyle=function(){document.body&&v(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){v(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_=d,e.replaceStyle_=function(t,e,n){d(t,n),v(t,f(e,n))},e.addStyle=v},446:(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},807:(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.1.4",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}},23: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(966),c=n(422),a=n(911),s=n(807),l=n(402);!function(t){t.molMap={},t.init=function(){var e,n,u=l.forDocument();Object.keys(u).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}());try{for(var p=o(Object.entries(u)),h=p.next();!h.done;h=p.next()){var f=r(h.value,2),d=f[0],v=f[1];t.molMap[d]||(t.molMap[d]=new i.Container(d,v))}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}}}(e.Base||(e.Base={}))},402: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(29),i=0;function c(t){t.querySelector("div.svg")?(t.setAttribute("has-svg","true"),r.rewriteTransformations(t.querySelector("div.svg > svg"))):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),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},29:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rewriteTransformations=void 0;var o=n(422);function r(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 i(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 c(t){var e=t;do{(e=e.parentNode).removeAttribute("transform")}while("svg"!==e.tagName)}e.rewriteTransformations=function(t){var e,n=o.toArray(t.querySelectorAll("text,polyline,line,rect,polygon,use,path"));return(e=n).forEach(r),e.forEach(c),e.filter((function(t){return t.hasAttribute("id")})).forEach(i),n}},113: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(911),c=n(446),a=n(807),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.update=function(){},e}(n(530).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},530: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(446),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},889: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(807),i=n(113),c=n(172),a=n(10),s=n(556),l=n(150),u=n(916);!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={}))},172: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(422),c=n(446),a=n(807),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(530).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},10: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(446),c=n(807),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(530).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},556: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(422),c=n(911),a=n(446),s=n(807),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(){this.message.parentNode.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(530).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},150: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(422),c=n(446),a=n(807),s=n(530),l=n(394),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},916: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(422),c=n(446),a=n(807),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.update=function(){},e}(n(530).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},250:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Bbox=void 0;var n=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.combineBboxes=function(e){var n=function(t){var e=t.getBBox();if(0===e.x&&0===e.y&&0===e.width&&0===e.height&&t.childNodes&&t.childNodes[0]&&t.childNodes[0].transform){var n=t.childNodes[0],o=void 0,r=void 0,i=void 0,c=void 0;if(n.x&&n.y&&n.width&&n.height)o=n.x.baseVal.value,r=n.y.baseVal.value,i=n.width.baseVal.value,c=n.height.baseVal.value;else{var a=n.getBBox();o=a.baseVal.x,r=a.baseVal.y,i=a.baseVal.width,c=a.baseVal.height}var s=t.ownerSVGElement.createSVGPoint(),l=n.transform.baseVal;s.x=o,s.y=r;for(var u=l.length-1;u>=0;u--)s=s.matrixTransform(l.getItem(u).matrix);e.x=s.x,e.y=s.y,e.width=i,e.height=c}return e},o=t.fromSvgRect(n(e[0]));return 1===e.length?o:e.slice(1).reduce((function(t,e){return t.combine(n(e))}),o)},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.viewBoxValue=function(){return this.x+" "+this.y+" "+this.width+" "+this.height},t}();e.Bbox=n},966: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(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,o=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},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(911),u=n(446),p=n(807),h=n(530),f=n(889),d=n(691),v=n(229),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 v.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 d.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(){t.prototype.activate.call(this),this.addStyles(),this.controllers.forEach((function(t){return t.activate()}))},e.prototype.deactivate=function(){this.controllers.forEach((function(t){return t.deactivate()})),this.removeStyles(),t.prototype.deactivate.call(this)},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];this.molecule.node.removeChild(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.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}(h.AbstractController);e.Container=g},88:(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},465:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Language=void 0;var o=n(422),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},495: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(807),i=n(465),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},229: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(422),c=n(250),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/5,yPad:this.svg.height.baseVal.value/5,duration:100,delay:10,wait:0,callback:function(){}},this.reset()}return t.prototype.reset=function(){this.setViewBox_(c.Bbox.fromSvgRect(this.svg.getBBox()))},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){for(var n=this,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},839: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(422),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(41).NeighbourHood);e.Atom=a},111: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(422),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(41).NeighbourHood);e.AtomSet=a},202: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(422),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(41).NeighbourHood);e.Bond=c},903: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(422),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},183: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(88),i=n(495),c=n(839),a=n(111),s=n(202),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},691:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Molecule=void 0;var o=n(422),r=n(183),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},171:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Neighbour=void 0;var o=n(422),r=n(122),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},41: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(422),c=n(903),a=n(171),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},122:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Via=void 0;var o=n(422),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},394: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(422),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}},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(807),r=n(23);t.Base=r.Base,t.Config=e.config,t.version=e.version})(),o})()}));
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})());
@@ -584,7 +584,9 @@ Line = element line {
584
584
  attribute reverse {"yes"|"no"}?,
585
585
  attribute additional-arrows {"yes"|"no"}?,
586
586
  StrokeAttributes,
587
- CommonAttributes
587
+ CommonAttributes,
588
+ LabelAttributes,
589
+ LabelText?
588
590
  }
589
591
 
590
592
  Network = element network {
@@ -1613,6 +1613,10 @@
1613
1613
  </optional>
1614
1614
  <ref name="StrokeAttributes"/>
1615
1615
  <ref name="CommonAttributes"/>
1616
+ <ref name="LabelAttributes"/>
1617
+ <optional>
1618
+ <ref name="LabelText"/>
1619
+ </optional>
1616
1620
  </element>
1617
1621
  </define>
1618
1622
  <define name="Network">
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefig
3
- Version: 0.4.7
3
+ Version: 0.5.0
4
4
  Summary: An authoring system for mathematical diagrams
5
5
  Home-page: https://prefigure.org
6
6
  License: GPL-3.0-or-later
@@ -12,17 +12,17 @@ prefig/core/clip.py,sha256=X3TcFYPuZwjZ9SFBWMc1MYY__6XTJqLafPeOLFNOdIE,806
12
12
  prefig/core/compat.py,sha256=_dI4aGtDrfhcw33r1SQS6kMwwgJj8dJ2A2GcLmtwX7o,729
13
13
  prefig/core/coordinates.py,sha256=vEAJ8kL9S1VylxWysqY5qW2WyCMyHj42yFkuAzjfqFs,3518
14
14
  prefig/core/definition.py,sha256=7LiaCxQwwEPdcnMpcMgrkZEfAoTc5ng8LO6Nf50Htwg,1033
15
- prefig/core/diagram.py,sha256=DuJw1fPddXH5ptVYQ2Zwta1CmfW4shVjd8WoaBcmqpM,25251
15
+ prefig/core/diagram.py,sha256=q9BbSm6bSbjnXdWUOvJWVu7zICc077CWext1g2iYing,26219
16
16
  prefig/core/diffeqs.py,sha256=aLXcmTsnfTG6L2-RiNfSaijzwmJF6xJcQpNQdDAWTQo,7127
17
17
  prefig/core/graph.py,sha256=q81dyJy3CxMWvMNhm74SZ9yjfltatdckmajxegA0z0A,10064
18
- prefig/core/grid_axes.py,sha256=v98C5tb9knNViGYGDrWL_ULb7Y78vMSQ6OJO7Xd0DXY,12165
18
+ prefig/core/grid_axes.py,sha256=Lb0uqkDkLlsiWOz5UeaY61zYnl_Tbh3FZXtvl-KawZA,12231
19
19
  prefig/core/group.py,sha256=KByOibuslP9TqSygNfPSaN4zU5oSRYaH2CPnR21ogTg,5825
20
20
  prefig/core/image.py,sha256=eQKy0mNvCE6J8EA1S5Y08YF3lrb7kCeGG4wrjBQ_-pI,4373
21
21
  prefig/core/implicit.py,sha256=JyFKpKj6Xi1PF-3BeZpd7t0aNe8jH9Wf_E2rghvt-Ug,6179
22
22
  prefig/core/label.py,sha256=iIL0QXyNOGbWSA8xLoPgkkxghTcyHRmdDQw07mvBGjY,25100
23
23
  prefig/core/label_tools.py,sha256=jOawiyrKC5iQs0vq7133xNXqrkJbMqDZVHflT-hOruo,9167
24
24
  prefig/core/legend.py,sha256=0mVfyU3LvqgDCYUOlCeBD04maV-rj2h0fs1aOEBBt6c,13340
25
- prefig/core/line.py,sha256=HBB9cvJawKAtdubISn5maRrzFFzV0NQuBgwoQoxeXcw,6055
25
+ prefig/core/line.py,sha256=3Q0bIYoKkKlTfdM-wMh9xXSQgEpMAwyWPAmJZgzDFzc,9038
26
26
  prefig/core/math_utilities.py,sha256=sMm3U9rcYKY8oZZWeJjcBokCDO4CxUkvmaX55auR4Eo,5927
27
27
  prefig/core/network.py,sha256=1izAX2AKvnj2knElrdLeojE_0Q0zO0aQM-EsEwor0Os,27217
28
28
  prefig/core/parametric_curve.py,sha256=WIg6BC4AIx6Hs_1Bl18BJYPY7vaCn80qyDn6OixK3Z0,3431
@@ -44,7 +44,7 @@ prefig/core/utilities.py,sha256=ndbB43tDDMj-RFUCCJAFgfdVb1gxYyr9WuHZoHEPC6c,2967
44
44
  prefig/core/vector.py,sha256=lTw-y9mt6jqmbFxdPwQB4PYBQ9y4pGrQRcpRp9lBIbY,2917
45
45
  prefig/engine.py,sha256=Zz7j2sFxeMwPN1f3GFTpaBihqguzMNJD5iBONOVL7eQ,11972
46
46
  prefig/resources/diagcess/diagcess.html,sha256=_JOwYjDRftpXN50J5na2Ck3TRffF4qUEcjCicjHF2Vw,6067
47
- prefig/resources/diagcess/diagcess.js,sha256=sjDf_HQHadUp8oPCyi6k2IQmczvezZASCuHADQV7Ex4,66652
47
+ prefig/resources/diagcess/diagcess.js,sha256=JvlGlBe3wizGm-XEOK62JlzAXhKNG9o0iHXLdEqPtVw,71017
48
48
  prefig/resources/examples/de-system.xml,sha256=jUd3XoHL-lf3vPd5BmGLXJDiXacK0yfK9qb2gWKiXz4,754
49
49
  prefig/resources/examples/derivatives.xml,sha256=UOntiHX18qFv_Lv6oWKa19jFA6A5tPp91lCOiGfZh4E,1606
50
50
  prefig/resources/examples/diffeqs.xml,sha256=AXX4SjMbfJZE1bCsn7PRNLHuK-eEt44ZhyIQAaIM5vY,1750
@@ -56,13 +56,13 @@ prefig/resources/examples/tangent.xml,sha256=FLZaNz0iFoTLX6gB4pfLZFtu_TWeCug4Dda
56
56
  prefig/resources/fonts/Braille29.ttf,sha256=T4hosDvaUGMVK0Wh0BmBgWeT7sQQmLXyA3gRUR-a0oE,55880
57
57
  prefig/resources/js/mj-sre-page.js,sha256=LHVeI4dCH13bTv56nz3SKNo3JGRXa6joPM3D3wpKV40,9251
58
58
  prefig/resources/js/package.json,sha256=hwKDg76_GzkhX72T7DRiF3FoMLokCv9PSLQvnW5Ovok,116
59
- prefig/resources/schema/pf_schema.rnc,sha256=MPbbVj90Dir2XCYtMEQBK6dLB1DCeY8qSYmxXR942Hg,20353
60
- prefig/resources/schema/pf_schema.rng,sha256=ltZTxdTirhws5RIldqdyDT-nC22udEqGCSL6aPmsJCQ,55089
59
+ prefig/resources/schema/pf_schema.rnc,sha256=cViGiAsiHqiLBqrVNGR06b_7yqQ_XNCiJ9Gz72jfyKo,20386
60
+ prefig/resources/schema/pf_schema.rng,sha256=6U72-HDhdS9drcKoTBVyBxo1XLXxMnPJvrQPMeOqxbc,55192
61
61
  prefig/resources/template/pf_publication.xml,sha256=eEv8HACv610Apw5DSVNy0reLfELYqHlNy9Oq0GH7C_c,200
62
62
  prefig/scripts/__init__.py,sha256=qJcPi1WRh9UAwu4zIFJbmxWalAMilMYqgi6LxRkF7bI,25
63
63
  prefig/scripts/install_mj.py,sha256=5A6-oc1xbIXka5mkFE70vlp9-Rh_QoxOxGMrQi9Hkio,1219
64
- prefig-0.4.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
65
- prefig-0.4.7.dist-info/METADATA,sha256=iMOTeN9sTfONPjxcnCeZdliOIKMA37KWXPpEUjB5N1A,8690
66
- prefig-0.4.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
- prefig-0.4.7.dist-info/entry_points.txt,sha256=OP4ZQT71q2b0Zfbie-oM2Z1HlxpkuX7qaxJnzwsBOVQ,42
68
- prefig-0.4.7.dist-info/RECORD,,
64
+ prefig-0.5.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
65
+ prefig-0.5.0.dist-info/METADATA,sha256=ujTSJNU9DH_xEBxY_tK1h9Yvc6xqvjhm4RWLAybmlEg,8690
66
+ prefig-0.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
67
+ prefig-0.5.0.dist-info/entry_points.txt,sha256=OP4ZQT71q2b0Zfbie-oM2Z1HlxpkuX7qaxJnzwsBOVQ,42
68
+ prefig-0.5.0.dist-info/RECORD,,
File without changes